package com.ss.android.article.base.feature.feed.vh;

import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Build;
import android.support.v4.content.ContextCompat;
import android.text.Layout;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.StaticLayout;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.ViewStub;
import android.view.ViewTreeObserver;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.bytedance.article.common.c.TTUtils;
import com.bytedance.common.utility.Logger;
import com.bytedance.common.utility.NetworkType;
import com.bytedance.common.utility.UIUtils;
import com.ss.android.action.ArticleActionHelper;
import com.ss.android.action.a.a.Comment;
import com.ss.android.article.base.app.AppData;
import com.ss.android.article.base.feature.c.FeedItemBehavior;
import com.ss.android.article.base.feature.e.ArticleShareHelper;
import com.ss.android.article.base.feature.feed.FeedCellStyleConfig;
import com.ss.android.article.base.feature.feed.activity.InfoLayout;
import com.ss.android.article.base.feature.feed.c.FeedDownloadAppAd;
import com.ss.android.article.base.feature.feed.cc;
import com.ss.android.article.base.feature.feed.ee;
import com.ss.android.article.base.feature.feed.k;
import com.ss.android.article.base.feature.model.Article;
import com.ss.android.article.base.feature.model.CellRef;
import com.ss.android.article.base.feature.model.MediaInfo;
import com.ss.android.article.base.feature.pgc.PgcActivity;
import com.ss.android.article.base.feature.video.IVideoController;
import com.ss.android.article.base.feature.video.IVideoController.IPlayCompleteListener;
import com.ss.android.article.base.feature.video.cache.VideoCacheController;
import com.ss.android.article.base.ui.BaseActionDialog;
import com.ss.android.article.base.ui.DiggLayout;
import com.ss.android.article.base.ui.DrawableButton;
import com.ss.android.article.base.ui.ForeGroundImageView;
import com.ss.android.article.base.ui.GridImageLayout;
import com.ss.android.article.base.ui.LargeVideoGrayAreaLayout;
import com.ss.android.article.base.utils.ArticleHelper;
import com.ss.android.article.base.utils.JSONObjectWrapper;
import com.ss.android.article.browser.R;
import com.ss.android.b.a.BaseAdsData;
import com.ss.android.common.callback.CallbackCenter;
import com.ss.android.common.callback.SSCallback;
import com.ss.android.common.dialog.AlertDialog;
import com.ss.android.common.download.DownloadAdapterProxy;
import com.ss.android.common.lib.MobClickCombiner;
import com.ss.android.common.util.NetworkStatusMonitor;
import com.ss.android.common.util.NetworkUtils;
import com.ss.android.image.AvatarLoader;
import com.ss.android.image.model.ImageInfo;
import com.ss.android.model.AbsArticle;
import com.ss.android.newmedia.BaseAppData;
import com.ss.android.newmedia.a.PopupToast;
import com.ss.android.newmedia.a.TimeFormatter;
import com.ss.android.newmedia.util.AppUtil;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;

public final class ArticleFeedViewHolder extends BaseFeedViewHolder implements cc, k {
    private View.OnClickListener cA = new View.OnClickListener() {
        public final void onClick(View arg9) {
            int v5 = R.id.switch_video_digg;
            int v7 = R.id.author_video_action;
            long v0 = 0;
            boolean v6 = true;
            if (arg9 != null) {
                int v2 = arg9.getId();
                if (v2 != v5 && v2 != R.id.switch_video_bury) {
                    if (v2 == R.id.bury_layout) {
                        a(false, mBuryLayout, mDiggLayout);
                    } else if (v2 == R.id.multi_video_bury_layout) {
                        a(false, mMoreCommentsDiggInfoLayoutHolder.mMultiVideoBuryLayout, mMoreCommentsDiggInfoLayoutHolder.mMultiVideoDiggLayout);
                    } else if (v2 == R.id.digg_layout) {
                        a(true, mBuryLayout, mDiggLayout);
                    } else if (v2 == R.id.multi_video_digg_layout) {
                        a(true, mMoreCommentsDiggInfoLayoutHolder.mMultiVideoBuryLayout, mMoreCommentsDiggInfoLayoutHolder.mMultiVideoDiggLayout);
                    } else if (v2 == R.id.author_video_digg_layout) {
                        a(true, mAuthorVideoBuryLayout, mAuthorVideoDiggLayout);
                    } else if (v2 == R.id.author_video_bury_layout) {
                        a(false, mAuthorVideoBuryLayout, mAuthorVideoDiggLayout);
                    } else {
                        if (v2 != R.id.cover_action_comment_count && v2 != R.id.video_comment_in_no_digg && v2 != R.id.comment_wrapper && v2 != R.id.comments_wrapper && v2 != R.id.author_video_comment_count && v2 != R.id.switch_video_comment_count) {
                            if (v2 != R.id.video_repost_in_no_digg) {
                                if (v2 == v7 && r == 4 || v2 == R.id.switch_video_action) {
                                    if (articleShareHelper == null) {
                                        return;
                                    }

                                    if (mCellRef == null) {
                                        return;
                                    }

                                    if (mCellRef.article == null) {
                                        return;
                                    }

                                    if (mCellRef != null) {
                                        v0 = mCellRef.adId;
                                    }

                                    articleShareHelper.b(mArticle, v0);
                                    return;
                                }

                                if (v2 != R.id.more && v2 != R.id.cover_action_repost) {
                                    if (v2 != v7) {
                                    } else if (r != 5) {
                                    } else if (articleShareHelper == null) {
                                    } else if (mCellRef == null) {
                                    } else if (mCellRef.article != null) {
                                        long v2_1 = mCellRef != null ? mCellRef.adId : v0;
                                        articleShareHelper.a(mArticle, v2_1, false, BaseActionDialog.DisplayMode.VIDEO_MORE_WITH_DIGG, true, ArticleShareHelper.u);
                                    } else {
                                    }

                                    return;
                                }

                                if (articleShareHelper == null) {
                                    return;
                                }

                                if (mCellRef == null) {
                                    return;
                                }

                                if (mCellRef.article == null) {
                                    return;
                                }

                                if (mCellRef != null) {
                                    v0 = mCellRef.adId;
                                }

                                articleShareHelper.a(mArticle, v0);
                            } else if (articleShareHelper == null) {
                            } else if (mCellRef == null) {
                            } else if (mCellRef.article != null) {
                                if (mCellRef != null) {
                                    v0 = mCellRef.adId;
                                }

                                articleShareHelper.a(mArticle, v0, false);
                            } else {
                            }

                            return;
                        }

                        BaseFeedViewHolder.a(context, mCellRef);
                        mAppData.h(mCellRef.category);
                        if (mArticle == null || mArticle.commentCount != 0) {
                            mFeedItemBehavior.handleItemClick(mPosition, arg9, new Object[]{Boolean.valueOf(true)});
                        } else {
                            mFeedItemBehavior.handleItemClick(mPosition, arg9, new Object[]{Boolean.valueOf(true), Boolean.valueOf(true)});
                        }
                        a("video_list_enter_comment");
                    }

                    return;
                }

                if (v2 != v5) {
                    v6 = false;
                }

                a(v6, mSwitchVideoBury, mSwitchVideoDigg);
            }
        }
    };
    private final View.OnClickListener cB = new View.OnClickListener() {

        public final void onClick(View arg4) {
            if (mCellRef.k()) {
                mAppData.h(mCellRef.category);
                BaseFeedViewHolder.a(context, mCellRef);
                mFeedItemBehavior.handleItemClick(mPosition, arg4, new Object[0]);
            } else {
                if (videoStyle == 9) {
                    UIUtils.setVisibility(mVideoSwitchInfosLayout, 0);
                    mDivider.setVisibility(View.GONE);
                    m();
                    ArticleFeedViewHolder.a(duplicatePressedRelativeLayout);
                }
                mAppData.a(mCellRef.category, mCellRef.cellId);
                o();
            }
        }
    };
    private ViewTreeObserver.OnPreDrawListener cC = new ViewTreeObserver.OnPreDrawListener() {

        public final boolean onPreDraw() {
            int v3 = 2;
            boolean v0 = true;
            mImage1Title.getViewTreeObserver().removeOnPreDrawListener(((ViewTreeObserver.OnPreDrawListener) this));
            if (mImage1Title.getLineCount() > v3) {
                mImage1InfoLayout.setVisibility(View.GONE);
                mImage1InfoLayout.b();
                mImage3InfoLayout.setVisibility(View.VISIBLE);
                mImage3InfoLayout.setDislikeOnClickListener(mDislikeOnClickListener);
                mImage3InfoLayout.setMoreActionClickListener(mMoreActionClickListener);
                InfoLayout.Info v0_1 = InfoLayout.Info.acquireInfo();
                g(v0_1);
                h(v0_1);
                c(v0_1);
                f(v0_1);
                d(v0_1);
                b(v0_1);
                e(v0_1);
                mImage3InfoLayout.a(v0_1);
                l();
                ((ViewGroup.MarginLayoutParams) mImage1Container.getLayoutParams()).bottomMargin = 0;
                ViewGroup.LayoutParams v0_2 = mImage3InfoLayout.getLayoutParams();
                if (!mAppData.getAppSettings().isFeedCellSpacingChange()) {
                    ((ViewGroup.MarginLayoutParams) v0_2).topMargin = context.getResources().getDimensionPixelSize(R.dimen.e7);
                } else if (mAppData.getAppSettings().isMaxCellSpacingChange()) {
                    ((ViewGroup.MarginLayoutParams) v0_2).topMargin = ((int) UIUtils.dp2px(context, 5f));
                } else {
                    ((ViewGroup.MarginLayoutParams) v0_2).topMargin = ((int) UIUtils.dp2px(context, 6f));
                }
                v0 = false;
            } else {
                if (mImage1Title.getLineCount() > 1) {
                    return v0;
                }

                if (!UIUtils.isVisible(mTopSourceLayout)) {
                    return v0;
                }

                mImage1Title.setMinLines(v3);
            }

            return v0;
        }
    };
    private ViewTreeObserver.OnPreDrawListener cD = new ViewTreeObserver.OnPreDrawListener() {

        public final boolean onPreDraw() {
            boolean v0 = false;
            mImage1Title.getViewTreeObserver().removeOnPreDrawListener(this);
            if (mImage1Title.getLineCount() == 1) {
                v = true;
                m();
            } else {
                v = false;
                v0 = true;
            }
            return v0;
        }
    };
    private IPlayCompleteListener mPlayCompleteListener = new IPlayCompleteListener() {

        public final void onItemShare(int channel) {
            if (channel > 0) {
                Article v1 = mArticle;
                IVideoController v2 = videoControllerContext.getVideoController();
                String v0 = "notfullscreen";
                if (v2 != null) {
                    v0 = v2.isFullScreen() ? "fullscreen" : "notfullscreen";
                }

                if (articleShareHelper == null) {
                    return;
                }

                if (v1 == null) {
                    return;
                }

                JSONObject jsonObject = new JSONObject();
                try {
                    jsonObject.put("source_type", "video");
                    jsonObject.put("section", "list_video_over");
                    jsonObject.put("fullscreen", v0);
                    jsonObject.put("icon_seat", "exposed");
                } catch (JSONException v0_1) {
                }

                articleShareHelper.fillShareParams(jsonObject);
                articleShareHelper.position = "list";
                articleShareHelper.share(channel, v1);
            }
        }

        public final void onReplay() {
        }

        public final void onShare() {
            Article v1 = mArticle;
            if (articleShareHelper != null && v1 != null) {
                articleShareHelper.a(v1, mCellRef.adId, true);
            }
        }
    };
    private static boolean[] cb = new boolean[3];
    private com.ss.android.article.base.ui.DiggAnimationView mDiggAnimationView;
    private PopupToast mPopupToast;
    private AtomicBoolean ce;
    private boolean showListDigg;
    private boolean cg = false;
    private boolean ch;
    private boolean ci;
    private boolean cj;
    private boolean ck;
    private int galleryStyle;
    private boolean cm;
    private boolean cn;
    private int itemHorizontalMargin;
    private boolean cp;
    private Integer cq;
    private View.OnClickListener cr = new View.OnClickListener() {

        public final void onClick(View view) {
            if (!android.support.design.a.isTextEmpty(mCellRef.sourceOpenUrl)) {
                AppUtil.b(context, mCellRef.sourceOpenUrl);
            }
        }
    };
    private View.OnClickListener cs = new View.OnClickListener() {

        public final void onClick(View view) {
            long v4 = 0;
            int v1 = 1;
            if (mArticle.videoSubjectId <= v4 || (android.support.design.a.isTextEmpty(mCellRef.sourceOpenUrl))) {
                MediaInfo mediaInfo = mArticle.mediaInfo;
                if (mediaInfo != null && mediaInfo.id > v4) {
                    int v0 = mCellRef.videoStyle == 7 ? 1 : 0;
                    switch (mCellRef.videoStyle) {
                        case 7: {
                            break;
                        }
                        case 8:
                        case 9: {
                            v0 = 0;
                            break;
                        }
                        default:
                            PgcActivity.startActivity(context, mediaInfo.id, mArticle.itemId, "video_feed_author", 0);
                            return;
                    }
                    JSONObjectWrapper v2 = new JSONObjectWrapper();
                    String v3 = "pgc";
                    if (v0 != 0) {
                        v1 = 0;
                    }
                    MobClickCombiner.onEvent(context, "video", "feed_enter_pgc", mArticle.groupId, mediaInfo.id, v2.put(v3, v1).jsonObject);
                    PgcActivity.startActivity(context, mediaInfo.id, mArticle.itemId, "video_feed_author", 0);
                }
            } else {
                AppUtil.b(context, mCellRef.sourceOpenUrl);
            }
        }
    };
    private SSCallback ct = new SSCallback() {

        public final Object onCallback(Object[] args) {
            int v7 = 2;
            long v2 = ((Long) args[1]).longValue();
            Object v0 = args[v7];
            if (mArticle != null && mArticle.groupId == v2) {
                ((AbsArticle.a) v0).a(mArticle);
                if (ArticleFeedViewHolder.this.t == v7) {
                    switch (ArticleFeedViewHolder.this.r) {
                        case 1: {
                            if (mDiggInfoLayout != null && mDiggInfoLayout.getVisibility() != View.GONE) {
                                ArticleFeedViewHolder.this.a(mDiggLayout, mBuryLayout);
                            }
                            return null;
                        }
                        case 3: {
                            if (mMoreCommentsDiggInfoLayoutHolder.mMoreCommentsDiggInfoLayout != null
                                    && mMoreCommentsDiggInfoLayoutHolder.mMoreCommentsDiggInfoLayout.getVisibility() != View.GONE) {
                                ArticleFeedViewHolder.this.a(
                                        mMoreCommentsDiggInfoLayoutHolder.mMultiVideoDiggLayout,
                                        mMoreCommentsDiggInfoLayoutHolder.mMultiVideoBuryLayout);
                            }
                            return null;
                        }
                        case 4: {
                            if (mDiggAuthorVideoLayout != null && mDiggAuthorVideoLayout.getVisibility() != View.GONE) {
                                mAuthorVideoDiggLayout.setSelected(mArticle.userDigg);
                                mAuthorVideoBuryLayout.setSelected(mArticle.userBury);
                            }
                            return null;
                        }
                        case 6: {
                            if (mVideoSwitchInfosLayout != null) {
                                ArticleFeedViewHolder.this.a(mSwitchVideoDigg, mSwitchVideoBury);
                            }
                            return null;
                        }
                    }
                    return null;
                }
            }
            return null;
        }
    };
    private SSCallback cu = new SSCallback() {
        public final Object onCallback(Object[] args) {
            Object v4 = null;
            if (args != null && args.length >= 3) {
                try {
                    int v0_1 = ((Integer) args[0]).intValue();
                    Object v1 = args[1];
                    if (args[2] != articleShareHelper) {
                        return v4;
                    }

                    String v2 = "xiangping";
                    switch (v0_1) {
                        case 1: {
                            if (v1 != mArticle) {
                                return v4;
                            }

                            MobClickCombiner.onEvent(context, v2, "video_list_favorite");
                            CallbackCenter.abortDispatch();
                            return v4;
                        }
                        case 2: {
                            if (v1 != mArticle) {
                                return v4;
                            }

                            MobClickCombiner.onEvent(context, v2, "video_list_unfavorite");
                            CallbackCenter.abortDispatch();
                            return v4;
                        }
                        case 3: {
                            if (mArticle.mediaInfo != v1) {
                                return v4;
                            }

                            MobClickCombiner.onEvent(context, v2, "video_list_pgc_button");
                            CallbackCenter.abortDispatch();
                            return v4;
                        }
                    }

                    return v4;


                } catch (Exception exception) {
                    if (!Logger.debug()) {
                        return v4;
                    }
                    exception.printStackTrace();
                }
            }
            return v4;
        }
    };
    private final View.OnClickListener cv = new View.OnClickListener() {
        public final void onClick(View view) {
            mFeedItemBehavior.handleCommentClick(mPosition, view);
        }
    };
    private View.OnClickListener cw = new View.OnClickListener() {
        public final void onClick(View arg4) {
            if (mCellRef.readCount > 0) {
                ++mCellRef.readCount;
            }
            BaseFeedViewHolder.a(context, mCellRef);
            mAppData.h(mCellRef.category);
            mFeedItemBehavior.handleItemClick(mPosition, arg4, new Object[0]);
        }
    };
    private final View.OnClickListener cx = new View.OnClickListener() {

        public final void onClick(View arg2) {
            ArticleFeedViewHolder.this.j();
        }
    };
    private final View.OnClickListener mLikeClickListener = new View.OnClickListener() {

        public final void onClick(View arg10) {
            Article v3 = mArticle;
            int v0 = mArticle.entityFollowed == 0 ? 1 : 0;
            v3.entityFollowed = v0;
            boolean v0_1 = mArticle.entityFollowed > 0 ? true : false;
            mEntityLike.setSelected(v0_1);
            TextView v2 = mEntityLike;
            int v1 = v0_1 ? R.string.topic_followed : R.string.topic_follow;
            v2.setText(v1);
            Context v1_1 = context;
            String v2_1 = "like";
            String v3_1 = v0_1 ? "list_like" : "list_unlike";
            MobClickCombiner.onEvent(v1_1, v2_1, v3_1, mArticle.groupId, 0, n());
        }
    };
    private final View.OnClickListener cz = new View.OnClickListener() {
        public final void onClick(View view) {
            MobClickCombiner.onEvent(context, "like", "list_click", mArticle.groupId, 0, n());
            String entityScheme = mArticle.entityScheme;
            if (!android.support.design.a.isTextEmpty(entityScheme)) {
                AppUtil.b(context, entityScheme);
            }
        }
    };
    public Article mArticle;
    public AvatarLoader mLargeItemAvatarLoader;
    public AvatarLoader mOneOrThreeItemAvatarLoader;
    int r;
    public ArticleShareHelper articleShareHelper;
    int t;
    int videoStyle;
    boolean v = false;
    final View.OnClickListener mDislikeOnClickListener = new View.OnClickListener() {

        public final void onClick(View arg4) {
            mFeedItemBehavior.handlePopIconClick(mPosition, arg4, 0);
        }
    };
    final View.OnClickListener mMoreActionClickListener = new View.OnClickListener() {

        public final void onClick(View v) {
            mFeedItemBehavior.handleMoreActionClick(mPosition, v, new Object[0]);
        }
    };

    public ArticleFeedViewHolder(Context context, NetworkStatusMonitor networkStatusMonitor, FeedItemBehavior feedItemBehavior,
                                 ArticleActionHelper articleActionHelper, int arg20, TimeFormatter timeFormatter,
                                 int arg22, int arg23, int arg24, int arg25, AtomicBoolean arg26, PopupToast popupToast,
                                 com.ss.android.article.base.ui.DiggAnimationView diggAnimationView) {
        this(context, networkStatusMonitor, feedItemBehavior, articleActionHelper, arg20, timeFormatter,
                arg22, arg23, arg24, arg25, arg26, popupToast, diggAnimationView, (byte) 0);
    }

    private ArticleFeedViewHolder(Context context,
                                  NetworkStatusMonitor networkStatusMonitor,
                                  FeedItemBehavior feedItemBehavior,
                                  ArticleActionHelper actualItemImageWidth,
                                  int actualItemImageHeight,
                                  TimeFormatter actualLargeImageWidth,
                                  int maxLargeImageHeight,
                                  int arg10,
                                  int arg11,
                                  int arg12,
                                  AtomicBoolean arg13,
                                  PopupToast popupToast,
                                  com.ss.android.article.base.ui.DiggAnimationView diggAnimationView,
                                  byte arg16) {
        super(context, networkStatusMonitor, feedItemBehavior,
                actualItemImageWidth, actualItemImageHeight,
                actualLargeImageWidth, maxLargeImageHeight, arg10, arg11, arg12);
        this.ce = arg13;
        this.mPopupToast = popupToast;
        this.mDiggAnimationView = diggAnimationView;
        if (this.mAppData != null) {
            this.showListDigg = this.mAppData.showListDigg();
        }
        this.itemHorizontalMargin = this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.feed_item_horizontal_margin);
    }

    private void Q() {
        int v4 = -3;
        if (this.t != 4 || this.galleryStyle != 0) {
            UIUtils.setLayoutMargins(this.mDivider, this.itemHorizontalMargin, ((int) UIUtils.dp2px(this.context, 0f)), this.itemHorizontalMargin, v4);
        } else {
            UIUtils.setLayoutMargins(this.mDivider, 0, ((int) UIUtils.dp2px(this.context, 0f)), 0, v4);
        }
    }

    public static int a(CellRef cellRef, int actualLargeImageWidth, int maxLargeImageHeight, NetworkStatusMonitor networkStatusMonitor) {
        int v0;
        if (cellRef == null || cellRef.article == null) {
            return -1;
        } else {
            if (cellRef.cellType == 0 && (cellRef.adId <= 0 || cellRef.Q == 0)) {
                v0 = cellRef.article == null
                        || cellRef.article.gallaryFlag <= 0
                        || cellRef.article.imageList == null
                        || cellRef.article.imageList.size() == 0 ? 0 : 1;
                if (v0 != 0) {
                    return 4;
                }

                Arrays.fill(cb, false);
                boolean[] v4 = cb;
                if (cellRef != null && cellRef.article != null && v4 != null && v4.length >= 3) {
                    boolean isAd = cellRef.adId > 0;
                    Article article = cellRef.article;
                    int loadImagePref = AppData.getInstance().mLoadImagePref;
                    boolean isLoadImage4G = AppData.getInstance().getAbSettings().isLoadImage4G();
                    NetworkType networkType = networkStatusMonitor.mCurrrentNetworkType;
                    boolean isWifiOn = networkStatusMonitor.isWifiOn();
                    boolean isNetworkOn = networkStatusMonitor.isNetworkOn();
                    boolean v1 = true;
                    boolean v2 = true;
                    boolean v3 = true;
                    if (ArticleHelper.getActualLargeImageHeight(
                            article.largeImageList,
                            actualLargeImageWidth,
                            isAd, maxLargeImageHeight) <= 0) {
                        v1 = false;
                    }

                    if (article.imageList == null || (article.imageList.isEmpty())) {
                        v2 = false;
                    }

                    if (article.middleImage == null) {
                        v3 = false;
                    }

                    if (cellRef != null && cellRef.videoStyle == 0 && (article.h())) {
                        v1 = false;
                    }

                    if (!isWifiOn
                            && !(isNetworkOn && loadImagePref == 1)
                            && !(isAd && loadImagePref != 2)
                            && !(isLoadImage4G && networkType == NetworkType.MOBILE_4G)
                            && !cellRef.g()) {
                        if (!isNetworkOn) {
                            v1 = false;
                            if (!v2) {
                                isAd = v3;
                            } else {
                                isAd = false;
                            }
                        } else {
                            v1 = false;
                            if (v3) {
                                v2 = false;
                                isAd = v3;
                            } else if (!v2) {
                                isAd = v3;
                            } else {
                                isAd = true;
                                v2 = false;
                            }
                        }
                    } else {
                        if (v1) {
                            v2 = false;
                            isAd = false;
                        } else if (v2) {
                            isAd = false;
                        } else {
                            isAd = v3;
                        }
                    }

                    v4[0] = v1;
                    v4[1] = v2;
                    v4[2] = isAd;
                }

                if (cb[0]) {
                    return 2;
                }

                if (cb[1]) {
                    return 1;
                }

                if (cb[2]) {
                    return 0;
                }

                return 3;
            } else {
                return -1;
            }
        }
    }

    private void a(int arg9, boolean arg10) {
        View[] v2;
        int v4 = 2;
        int v1 = 0;
        View[] v0 = null;
        if (arg9 == 1) {
            v0 = new View[v4];
            v0[0] = this.mDiggLayout;
            v0[1] = this.mBuryLayout;
            v2 = v0;
        } else if (arg9 == v4) {
            v0 = new View[4];
            v0[0] = this.mVideoSourceInNoDigg;
            v0[1] = this.mVideoDurationInNoDigg;
            v0[v4] = this.mVideoCommentInNoDigg;
            v0[3] = this.mVideoRepostInNoDigg;
            v2 = v0;
        } else {
            v2 = v0;
        }

        if (v2 != null) {
            int v0_1 = arg10 ? this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.iw) : this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.iv);
            int v3 = v2.length;
            while (v1 < v3) {
                View v4_1 = v2[v1];
                if (v4_1 != null) {
                    v4_1.setPadding(v4_1.getPaddingLeft(), v4_1.getPaddingTop(), v4_1.getPaddingRight(), v0_1);
                }
                ++v1;
            }
        }
    }

    static void a(View arg9) {
        int v8 = -3;
        if (arg9 != null && ((arg9.getParent() instanceof ListView))) {
            ViewParent v0 = arg9.getParent();
            if (((ListView) v0).getChildCount() > 1) {
                int v4 = ((ListView) v0).getChildCount();
                int v2;
                for (v2 = 0; v2 < v4; ++v2) {
                    View v1 = ((ListView) v0).getChildAt(v2);
                    if (v1 != arg9 && v1 != null && ((v1.getTag() instanceof ArticleFeedViewHolder))) {
                        Object v1_1 = v1.getTag();
                        if (((ArticleFeedViewHolder) v1_1).mVideoSwitchInfosLayout != null && ((ArticleFeedViewHolder) v1_1).mVideoSwitchInfosLayout.getVisibility() == View.VISIBLE) {
                            ((ArticleFeedViewHolder) v1_1).mVideoSwitchInfosLayout.setVisibility(View.GONE);
                            ((ArticleFeedViewHolder) v1_1).mDivider.setVisibility(View.VISIBLE);
                            UIUtils.setLayoutMargins(((ArticleFeedViewHolder) v1_1).mDivider, 0, v8, 0, v8);
                            UIUtils.setLayoutParams(((ArticleFeedViewHolder) v1_1).mDivider, v8, ((int) UIUtils.dp2px(((ArticleFeedViewHolder) v1_1).context, 2f)));
                            ((ArticleFeedViewHolder) v1_1).mDivider.setBackgroundResource(com.ss.android.article.browser.R.color.ssxinmian4);
                        }
                    }
                }
            }
        }
    }

    private void a(View arg3, int arg4) {
        if (arg3 != null && this.context != null) {
            if (this.mPopupToast == null) {
                this.mPopupToast = new PopupToast(this.context);
            }

            this.mPopupToast.showToast(com.ss.android.article.browser.R.drawable.close_popup_textpage, arg4);
        }
    }

    private void a(TextView textView) {
        if (android.support.design.a.isTextEmpty(this.mArticle.title)) {
            UIUtils.setVisibility(textView, 8);
        } else {
            if (this.ci) {
                if (this.t == 4 && this.galleryStyle == 0) {
                } else {
                    textView.setTextSize(18f);
                    ViewGroup.LayoutParams v0 = textView.getLayoutParams();
                    if (this.t != 0) {
                        ((LinearLayout.LayoutParams) v0).setMargins(((LinearLayout.LayoutParams) v0).leftMargin,
                                ((int) UIUtils.dp2px(this.context, 10f)),
                                ((LinearLayout.LayoutParams) v0).rightMargin,
                                ((LinearLayout.LayoutParams) v0).bottomMargin);
                    } else {
                        ((LinearLayout.LayoutParams) v0).setMargins((
                                        (LinearLayout.LayoutParams) v0).leftMargin,
                                ((int) UIUtils.dp2px(this.context, 0f)),
                                ((LinearLayout.LayoutParams) v0).rightMargin,
                                ((LinearLayout.LayoutParams) v0).bottomMargin);
                    }

                    TextPaint v0_1 = textView.getPaint();
                    if (this.mAppData.getAbSettings().isTitleBold()) {
                        v0_1.setFakeBoldText(true);
                    } else {
                        v0_1.setFakeBoldText(false);
                    }

                    textView.setLineSpacing(UIUtils.dp2px(this.context, 2f), 1f);
                }
            } else {
                textView.getPaint().setFakeBoldText(false);
            }
            AppData.isNightMode();
            textView.setText(a(this.context, this.mArticle.title, this.mCellRef.title));
            textView.setEnabled(this.mArticle.clickTimestamp <= 0);
            textView.requestLayout();
        }
    }

    private boolean a(ViewGroup arg9, ForeGroundImageView foreGroundImageView, TextView arg11, TextView arg12) {
        boolean v0_1;
        String avatarUrl;
        View.OnClickListener v2 = null;
        int v7 = View.GONE;
        if (foreGroundImageView == null || arg11 == null || arg12 == null || arg9 == null) {
            v0_1 = false;
        } else {
            String v0 = android.support.design.a.j(this.mArticle.source);
            MediaInfo mediaInfo = this.mArticle.mediaInfo;
            if (mediaInfo != null) {
                avatarUrl = android.support.design.a.j(mediaInfo.avatarUrl);
                if (android.support.design.a.isTextEmpty(v0)) {
                    v0 = android.support.design.a.j(mediaInfo.name);
                }
            } else {
                avatarUrl = null;
            }

            if (android.support.design.a.isTextEmpty(v0)) {
                arg9.setVisibility(v7);
                v0_1 = false;
                return v0_1;
            }

            if (android.support.design.a.isTextEmpty(avatarUrl)) {
                avatarUrl = android.support.design.a.j(this.mCellRef.sourceAvatar);
            }

            arg9.setVisibility(View.VISIBLE);
            boolean v5_1 = !android.support.design.a.isTextEmpty(this.mCellRef.sourceOpenUrl) ? true : false;
            if (v5_1) {
                v2 = this.cr;
            }

            arg9.setOnClickListener(v2);
            arg9.setClickable(v5_1);
            if (!android.support.design.a.isTextEmpty(avatarUrl)) {
                foreGroundImageView.setVisibility(View.VISIBLE);
                arg11.setVisibility(v7);
                this.mLargeItemAvatarLoader.loadAvatar(foreGroundImageView, avatarUrl);
            } else {
                foreGroundImageView.setVisibility(v7);
                arg11.setVisibility(View.VISIBLE);
                arg11.setText(v0.substring(0, 1));
            }

            arg12.setText(v0);
            v0_1 = true;
        }

        return v0_1;
    }

    protected final void a(InfoLayout.Info info) {
        if (!(this.context instanceof ee)) {
            String v1 = null;
            int v0 = 0;
            if (this.mArticle == null || !this.mArticle.userRepin) {
                super.a(info);
                if ((info.a & 32) > 0) {
                    return;
                } else if (!this.B()) {
                    return;
                } else if (this.mCellRef.isRecommend()) {
                    v1 = this.context.getResources().getString(com.ss.android.article.browser.R.string.recommend_article);
                    v0 = 11;
                } else if (this.mCellRef.isHot()) {
                    v1 = this.context.getResources().getString(com.ss.android.article.browser.R.string.hot_article);
                    v0 = 10;
                }
            } else {
                v1 = this.context.getResources().getString(com.ss.android.article.browser.R.string.collected_article);
                v0 = 12;
            }

            if (android.support.design.a.isTextEmpty(v1)) {
                return;
            }

            info.a |= 32;
            info.c = v1;
            info.labelStyle = v0;
        }
    }

    protected final void initWidthOrigin(BaseFeedViewHolder arg1) {
        super.initWidthOrigin(arg1);
        this.s();
    }

    public final void a(DiggLayout arg2, DiggLayout arg3) {
        if (arg2 != null) {
            arg2.setText(android.support.design.a.c(this.mArticle.diggCount));
            arg2.setSelected(this.mArticle.userDigg);
        }

        if (arg3 != null) {
            arg3.setText(android.support.design.a.c(this.mArticle.buryCount));
            arg3.setSelected(this.mArticle.userBury);
        }
    }

    final void a(String arg3) {
        if (this.context != null && !android.support.design.a.isTextEmpty(arg3)) {
            MobClickCombiner.onEvent(this.context, "xiangping", arg3);
        }
    }

    public final void a(boolean arg8) {
        IVideoController videoController;
        if (arg8) {
            if (this.videoControllerContext != null) {
                videoController = this.videoControllerContext.getVideoController();
                if (videoController != null
                        && this.mArticle != null
                        && !android.support.design.a.isTextEmpty(this.mArticle.videoId)
                        && (this.videoControllerContext.isStreamTab())
                        && (this.mArticle.videoId.equals(videoController.getVideoId()))) {
                    videoController.releaseMedia();
                }
            }
        } else if (this.videoControllerContext != null
                && (this.networkMonitor.isNetworkOn())
                && this.mAppData.videoAutoPlayModeLocalSp != 2
                && (this.mAppData.videoAutoPlay())) {
            videoController = this.videoControllerContext.getVideoController();
            if (videoController != null && this.mArticle != null && !android.support.design.a.isTextEmpty(this.mArticle.videoId) && (this.videoControllerContext.isStreamTab()) && !videoController.isVideoPlaying()) {
                if ((!this.mAppData.userAllowUseMobileNet || this.mAppData.videoAutoPlayModeLocalSp != 0) && !NetworkUtils.isWifi(this.context)) {
                    return;
                }

                this.videoControllerContext.initVideoView();
                this.mAppData.article = this.mArticle;
                int v2 = this.actualLargeImageWidth;
                int v3 = this.mLargeImage.getHeight();
                if (this.mArticle.videoId.equals(videoController.getVideoId())) {
                    int v1 = this.mAppData.videoPlayContinueFlag == 1 ? 1 : 0;
                    if (v1 != 0) {
                        if (!videoController.isPauseFromList()) {
                            return;
                        }

                        this.mAppData.article = this.mArticle;
                        videoController.resumeMedia(this.mLargeImage, this.mRelatedVideoContainer);
                        videoController.continuePlay(true);
                        return;
                    }

                    videoController.releaseMedia();
                    return;
                }

                videoController.play(
                        this.mCellRef,
                        v2,
                        v3,
                        this.mLargeImage,
                        this.mRelatedVideoContainer,
                        true);
            }
        }
    }

    final void a(boolean arg13, DiggLayout diggLayout, DiggLayout arg15) {
        int v2;
        int v4 = 2;
        DiggLayout v0 = arg13 ? arg15 : diggLayout;
        if (this.mArticle.userDigg) {
            this.a(v0, com.ss.android.article.browser.R.string.ss_hint_digg);
        } else if (this.mArticle.userBury) {
            this.a(v0, com.ss.android.article.browser.R.string.ss_hint_bury);
        } else {
            String v0_1 = arg13 ? "video_list_digg" : "video_list_bury";
            this.a(v0_1);
            long v0_2 = 0;
            if (this.mCellRef != null && this.mCellRef.article == this.mArticle) {
                v0_2 = this.mCellRef.adId;
            }

            Article v7 = this.mArticle;
            if (this.articleActionHelper != null && this.mAppData != null && v7 != null) {
                if (arg13) {
                    v7.userDigg = true;
                    ++v7.diggCount;
                    v2 = 1;
                } else {
                    v7.userBury = true;
                    ++v7.buryCount;
                    v2 = v4;
                }

                AbsArticle.a v8 = new AbsArticle.a();
                int v5 = v7.userDigg ? 1 : 0;
                v8.userDigg = v5;
                v8.diggCount = v7.diggCount;
                v5 = v7.userBury ? 1 : 0;
                v8.userBury = v5;
                v8.buryCount = v7.buryCount;
                CallbackCenter.TYPE v5_1 = BaseAppData.callbackTypeSpipeItemStateChanged;
                Object[] v9 = new Object[3];
                v9[0] = BaseAppData.callbackTypeSpipeItemStateChanged;
                v9[1] = Long.valueOf(v7.groupId);
                v9[v4] = v8;
                CallbackCenter.notifyCallback(v5_1, v9);
                this.articleActionHelper.a(v2, v7, v0_2);
            }

            v0 = arg13 ? arg15 : diggLayout;
            if (this.mArticle == null) {
                return;
            }

            if (diggLayout == null) {
                return;
            }

            if (arg15 == null) {
                return;
            }

            if (v0 == null) {
                return;
            }

            if (diggLayout == this.mAuthorVideoBuryLayout || arg15 == this.mAuthorVideoDiggLayout) {
                v0.onDiggClick();
            } else {
                arg15.setText(android.support.design.a.c(this.mArticle.diggCount));
                diggLayout.setText(android.support.design.a.c(this.mArticle.buryCount));
                v0.onDiggClick();
            }

            arg15.setSelected(this.mArticle.userDigg);
            diggLayout.setSelected(this.mArticle.userBury);
        }
    }

    public final CellRef b() {
        return this.mCellRef;
    }

    final void b(InfoLayout.Info arg2) {
        if (this.mCellRef.p()) {
            arg2.a |= 4;
            arg2.g = this.mArticle.reason;
        }
    }

    protected final void c(InfoLayout.Info arg2) {
        if (!this.ch) {
            if (this.mCellRef.p()) {
                arg2.a |= 16;
                arg2.j = this.mCellRef.sourceIcon;
            } else {
                super.c(arg2);
            }
        }
    }

    final void d(InfoLayout.Info arg7) {
        long v4 = 0;
        if (!this.mCellRef.f() && (this.mCellRef.n()) && !UIUtils.isVisible(this.mTopSourceLayout)) {
            String v0 = "";
            if (this.mCellRef.o()) {
                MediaInfo v1 = this.mArticle.mediaInfo;
                if (v1 != null && !android.support.design.a.isTextEmpty(v1.avatarUrl) && this.mCellRef.adId <= v4) {
                    arg7.avatarUrl = android.support.design.a.j(v1.avatarUrl);
                } else if (!android.support.design.a.isTextEmpty(this.mCellRef.sourceAvatar)) {
                    arg7.avatarUrl = android.support.design.a.j(this.mCellRef.sourceAvatar);
                }

                arg7.a |= 128;
                arg7.i = this.mCellRef.sourceIconStyle;
                if (v1 == null) {
                } else {
                    v0 = v1.name;
                }
            }
            if (!android.support.design.a.isTextEmpty(v0) && this.mCellRef.adId <= v4) {
                arg7.a |= 1;
                arg7.d = v0;
                return;
            }

            String v1_1 = android.support.design.a.j(this.mArticle.source);
            v0 = this.mCellRef.article == null || this.mCellRef.article.aF == null
                    || !(this.mCellRef.article.aF instanceof FeedDownloadAppAd)
                    || ((FeedDownloadAppAd) this.mCellRef.article.aF).uiType == 0 || (this.ci) ? v1_1 : "";
            if (this.mFeedType == 4) {
                v0 = this.context.getString(com.ss.android.article.browser.R.string.rz) + String.valueOf(this.mCellRef.goDetailCount);
            }

            if (v0 == null) {
                return;
            }

            if (android.support.design.a.isTextEmpty(v0.trim())) {
                return;
            }

            arg7.a |= 1;
            arg7.d = v0;
        }
    }

    public final boolean d() {
        return this.cg;
    }

    public final void e() {
        this.cg = false;
    }

    final void e(InfoLayout.Info arg4) {
        if (this.mCellRef.h()) {
            int v0 = this.mArticle.diggCount;
            if (v0 > 0 && this.mFeedType != 4) {
                arg4.k = android.support.design.a.c(v0) + this.context.getString(com.ss.android.article.browser.R.string.update_digg);
                arg4.a |= 512;
            }
        }
    }

    public final void loadImage() {
        ImageInfo v1;
        int v0 = 0;
        Object v4 = null;
        int v3 = com.ss.android.article.browser.R.id.image_info;
        if (this.t == 4) {
            GridImageLayout v0_1 = this.gridImageLayout;
            switch (v0_1.k) {
                case 1: {
                    GridImageLayout.a(v0_1.a);
                    break;
                }
                default: {
                    GridImageLayout.a(v0_1.a);
                    GridImageLayout.a(v0_1.b);
                    GridImageLayout.a(v0_1.c);
                    break;
                }
            }
        } else {
            if (this.t != 1) {
                if (this.t == 0) {
                    ImageInfo v0_2 = ArticleHelper.getImageInfoTag(this.mImage1ImageView);
                    if (v0_2 == null) {
                    } else {
                        android.support.design.a.setImage(this.mImage1ImageView, v0_2);
                        this.mImage1ImageView.setTag(v3, v4);
                    }
                } else if (this.t != 2) {
                } else {
                    v1 = ArticleHelper.getImageInfoTag(this.mLargeImage);
                    if (v1 == null) {
                    } else {
                        if (this.mCellRef.f()) {
                            this.mCoverTopShaow.setVisibility(View.VISIBLE);
                        }

                        android.support.design.a.setImage(this.mLargeImage, v1);
                        this.mLargeImage.setTag(v3, v4);
                    }
                }
            } else if (this.mImage3ImageContainerView != null && this.mImage3ImageContainerView.getVisibility() == View.VISIBLE) {
                if (this.mImage3ImageViews == null) {
                } else {
                    while (true) {
                        if (v0 >= 3) {
                            break;
                        }

                        v1 = ArticleHelper.getImageInfoTag(this.mImage3ImageViews[v0]);
                        if (v1 != null) {
                            android.support.design.a.setImage(this.mImage3ImageViews[v0], v1);
                            this.mImage3ImageViews[v0].setTag(v3, v4);
                        }

                        ++v0;
                    }
                }
            }
        }

        if (this.duplicatePressedRelativeLayout != null) {
            this.duplicatePressedRelativeLayout.post(new Runnable() {
                public final void run() {
                    VideoCacheController.getInstance().tryPreLoadVideoInCell(mCellRef);
                }
            });
        }
    }

    final void f(InfoLayout.Info arg5) {
        if (this.mCellRef.i()) {
            String v0 = this.mCellRef.infoDesc;
            if (!android.support.design.a.isTextEmpty(v0)) {
                arg5.e = v0;
                arg5.a |= 2;
            } else {
                int v0_1 = this.mArticle.commentCount;
                if (v0_1 > 0) {
                    if (this.mFeedType == 4) {
                        arg5.e = this.context.getString(com.ss.android.article.browser.R.string.s4) + android.support.design.a.c(this.mArticle.repinCount);
                        arg5.a |= 2;
                    } else if (this.mArticle.isLiveVideo()) {
                        arg5.e = String.format(this.context.getString(com.ss.android.article.browser.R.string.video_live_watch_count), android.support.design.a.c(this.mArticle.videoWatchCount));
                        arg5.a |= 2;
                    } else {
                        arg5.e = android.support.design.a.c(v0_1) + this.context.getString(com.ss.android.article.browser.R.string.comment_prefix);
                        arg5.a |= 2;
                    }
                }
            }
        }
    }

    protected final void g() {
        InfoLayout.Info info;
        int[] v2_3;
        Context context;
        TextView textView;
        int v1_2;
        Context v2;
        String avatarUrl;
        MediaInfo mediaInfo;
        ViewGroup.LayoutParams layoutParams;
        super.g();
        this.mArticle = this.mCellRef.article;
        this.t = -1;
        if (this.mArticle != null) {
            if (this.articleShareHelper != null) {
                CallbackCenter.addCallback(BaseAppData.callbackTypeFeedArticleUmeng, this.cu);
            }

            CallbackCenter.addCallback(BaseAppData.callbackTypeSpipeItemStateChanged, this.ct);
            this.t = a(this.mCellRef, this.actualLargeImageWidth, this.maxLargeImageHeight, this.networkMonitor);
            this.mDeleteTextView.setOnClickListener(this.cx);
            this.duplicatePressedRelativeLayout.setOnClickListener(this.cw);
            this.ck = this.mCellRef.f();
            this.videoStyle = this.mCellRef.videoStyle;
            this.galleryStyle = this.mCellRef.galleryStyle;
            this.cm = this.mArticle.k();
            this.cn = this.mCellRef.adId > 0 ? true : false;
            int v0_1 = this.mCellRef == null || (this.mCellRef.cellFlag & 128) != 128 ? 0 : 1;
            this.cj = v0_1 == 0 || (this.cn) ? false : true;
            v0_1 = (this.mCellRef.cellFlag & 16) > 0 ? 1 : 0;
            boolean v0 = v0_1 == 0 || this.t != 0 ? false : true;
            this.ch = v0;
            if (this.mImage3InfoLayout.mAvatarLoader == null) {
                this.mImage3InfoLayout.mAvatarLoader = this.mOneOrThreeItemAvatarLoader;
            }

            if (this.mCellRef.j()) {
                this.ci = true;
                this.mNewInfoLayoutStub = this.duplicatePressedRelativeLayout.findViewById(com.ss.android.article.browser.R.id.new_info_layout_stub);
                if (this.mNewInfoLayout == null) {
                    this.mNewInfoLayoutStub.inflate();
                    this.mNewInfoLayout = this.duplicatePressedRelativeLayout.findViewById(com.ss.android.article.browser.R.id.new_info_layout);
                    if (this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                        if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                            UIUtils.setLayoutMargins(this.mNewInfoLayout, -3, ((int) UIUtils.dp2px(this.context, 5f)), -3, -3);
                        } else {
                            UIUtils.setLayoutMargins(this.mNewInfoLayout, -3, ((int) UIUtils.dp2px(this.context, 6f)), -3, -3);
                        }
                    }
                }
            } else {
                this.ci = false;
            }

            this.v = false;
            if (this.t != 4) {
                if (this.t == 2) {
                    if ((this.mCellRef.f()) || this.videoStyle == 5) {
                        this.mImage3Title.setVisibility(View.GONE);
                    } else {
                        this.mImage3Title.setVisibility(View.VISIBLE);
                        this.a(this.mImage3Title);
                        if (this.cj) {
                            this.initTopSourceLayout();
                            if (this.a(this.mTopSourceLayout, this.mTopSourceIcon, this.mTopSourceIconTv, this.mTopSourceText)) {
                                UIUtils.setLayoutMargins(this.mImage3Title, -3, 0, -3, -3);
                            }
                        }
                    }

                    this.r = 0;
                    if (this.videoStyle == 5) {
                        this.r = 3;
                    } else if (this.mCellRef.f()) {
                        if ((this.mCellRef.videoStyle == 3 || this.mCellRef.videoStyle == 6) && (this.showListDigg)) {
                            this.r = 1;
                        } else if ((this.mCellRef.videoStyle != 3 && this.mCellRef.videoStyle != 6 || (this.showListDigg)) && this.mCellRef.videoStyle != 4) {
                            if (this.mCellRef.videoStyle == 7) {
                                this.r = 4;
                            } else if (this.mCellRef.videoStyle == 8) {
                                this.r = 5;
                            } else if (this.mCellRef.videoStyle == 9) {
                                this.r = 6;
                            } else {
                            }
                        } else {
                            this.r = 2;
                        }
                    }

                    if (this.r == 0) {
                        info = InfoLayout.Info.acquireInfo();
                        this.g(info);
                        this.h(info);
                        this.c(info);
                        this.f(info);
                        this.d(info);
                        this.b(info);
                        this.e(info);
                        if (this.ci) {
                            this.i(info);
                            UIUtils.setLayoutMargins(this.mDivider, 0, ((int) UIUtils.dp2px(this.context, 14f)), 0, -3);
                        } else {
                            this.mImage3InfoLayout.setVisibility(View.VISIBLE);
                            this.mImage3InfoLayout.a(info);
                            this.mImage3InfoLayout.setDislikeOnClickListener(this.mDislikeOnClickListener);
                            this.mImage3InfoLayout.setMoreActionClickListener(this.mMoreActionClickListener);
                            UIUtils.setLayoutMargins(this.mDivider, this.itemHorizontalMargin, -3, this.itemHorizontalMargin, -3);
                        }

                        layoutParams = this.mImage3InfoLayout.getLayoutParams();
                        if (this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                            if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                                ((ViewGroup.MarginLayoutParams) layoutParams).topMargin = ((int) UIUtils.dp2px(this.context, 5f));
                            } else {
                                ((ViewGroup.MarginLayoutParams) layoutParams).topMargin = ((int) UIUtils.dp2px(this.context, 6f));
                            }
                        } else {
                            ((ViewGroup.MarginLayoutParams) layoutParams).topMargin = this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.e7);
                        }
                    } else {
                        if (this.r == 1) {
                            if (this.mDiggInfoLayout == null) {
                                this.mDiggInfoLayout = ((ViewStub) this.duplicatePressedRelativeLayout.findViewById(com.ss.android.article.browser.R.id.digg_info_layout_stub)).inflate();
                                this.mDiggLayout = this.mDiggInfoLayout.findViewById(com.ss.android.article.browser.R.id.digg_layout);
                                this.mBuryLayout = this.mDiggInfoLayout.findViewById(com.ss.android.article.browser.R.id.bury_layout);
                                v0_1 = UIUtils.diggLayoutWidth(this.duplicatePressedRelativeLayout.getContext());
                                this.mDiggLayout.getLayoutParams().width = v0_1;
                                this.mBuryLayout.getLayoutParams().width = v0_1;
                                this.mCoverActionCommentCount = this.mDiggInfoLayout.findViewById(com.ss.android.article.browser.R.id.cover_action_comment_count);
                                this.mCoverActionReport = this.mDiggInfoLayout.findViewById(com.ss.android.article.browser.R.id.cover_action_repost);
                                if (this.mIsNightMode) {
                                    super.adaptDiggInfoLayoutNightMode();
                                }
                            }

                            this.mDiggInfoLayout.setVisibility(View.VISIBLE);
                            this.mDiggLayout.setText(android.support.design.a.c(this.mArticle.diggCount));
                            this.mBuryLayout.setText(android.support.design.a.c(this.mArticle.buryCount));
                            android.support.design.a.a(this.mCoverActionCommentCount, this.mArticle.commentCount);
                            this.mDiggLayout.setSelected(this.mArticle.userDigg);
                            this.mBuryLayout.setSelected(this.mArticle.userBury);
                            this.mDiggLayout.setOnClickListener(this.cA);
                            this.mBuryLayout.setOnClickListener(this.cA);
                            this.mCoverActionCommentCount.setOnClickListener(this.cA);
                            this.mCoverActionReport.setOnClickListener(this.cA);
                        } else if (this.r == 4) {
                            this.initDiggAuthorVideoLayout();
                            this.mDiggAuthorVideoLayout.setVisibility(View.VISIBLE);
                            mediaInfo = this.mArticle.mediaInfo;
                            if (mediaInfo != null) {
                                UIUtils.setVisibility(this.mAuthorAvatar, 8);
                                UIUtils.setTextAndVisibility(this.mAuthorName, mediaInfo.name);
                                if (this.mAuthorName.getVisibility() == View.VISIBLE) {
                                    this.mAuthorName.setTextColor(ContextCompat.getColorStateList(this.context, com.ss.android.article.browser.R.color.ssxinzi2_selector));
                                }
                            } else {
                                UIUtils.setVisibility(this.mAuthorAvatar, 8);
                                UIUtils.setTextAndVisibility(this.mAuthorName, this.mArticle.source);
                            }

                            UIUtils.setVisibility(this.mAuthorVideoDiggLayout, 0);
                            UIUtils.setVisibility(this.mAuthorVideoBuryLayout, 0);
                            UIUtils.setVisibility(this.mAuthorVideoWatchCount, 8);
                            this.mAuthorVideoDiggLayout.setSelected(this.mArticle.userDigg);
                            this.mAuthorVideoBuryLayout.setSelected(this.mArticle.userBury);
                            android.support.design.a.a(this.mAuthorVideoCommentCount, this.mArticle.commentCount);
                            UIUtils.setVisibility(this.mAuthorDivider, 0);
                            this.mAuthorVideoAction.setImageResource(com.ss.android.article.browser.R.drawable.video_cover_comm_repost);
                            v0_1 = UIUtils.percentWidth(this.context, 0.0375f);
                            this.mAuthorVideoAction.setPadding(v0_1, 0, v0_1, 0);
                            UIUtils.setLayoutMargins(this.mAuthorVideoAction, 0, -3, -3, -3);
                            this.mAuthorVideoDiggLayout.setOnClickListener(this.cA);
                            this.mAuthorVideoBuryLayout.setOnClickListener(this.cA);
                            this.mAuthorVideoCommentCount.setOnClickListener(this.cA);
                            this.mAuthorVideoAction.setOnClickListener(this.cA);
                            this.mAuthorAvatarWrapper.setOnClickListener(this.cs);
                            this.mAuthorName.setOnClickListener(this.cs);
                            UIUtils.setLayoutMargins(this.mDivider, 0, -3, 0, -3);
                            UIUtils.setLayoutParams(this.mDivider, -3, ((int) UIUtils.dp2px(this.context, 11f)));
                            this.mDivider.setBackgroundResource(com.ss.android.article.browser.R.color.ssxinxian1);
                            this.mDivider.setImageResource(com.ss.android.article.browser.R.color.ssxinmian3);
                            v0_1 = ((int) UIUtils.dp2px(this.context, 0.5f));
                            this.mDivider.setPadding(0, v0_1, 0, v0_1);
                        } else if (this.r == 5) {
                            this.initDiggAuthorVideoLayout();
                            this.mDiggAuthorVideoLayout.setVisibility(View.VISIBLE);
                            mediaInfo = this.mArticle.mediaInfo;
                            if (mediaInfo != null) {
                                avatarUrl = mediaInfo.avatarUrl;
                                if (!android.support.design.a.isTextEmpty(avatarUrl)) {
                                    UIUtils.setVisibility(this.mAuthorAvatar, 0);
                                    this.mLargeItemAvatarLoader.loadAvatar(this.mAuthorAvatar, avatarUrl);
                                } else {
                                    UIUtils.setVisibility(this.mAuthorAvatar, 8);
                                }

                                UIUtils.setTextAndVisibility(this.mAuthorName, mediaInfo.name);
                                if (this.mAuthorName.getVisibility() != View.VISIBLE) {
                                } else {
                                    this.mAuthorName.setTextColor(ContextCompat.getColorStateList(this.context, com.ss.android.article.browser.R.color.yp));
                                }
                            } else {
                                UIUtils.setVisibility(this.mAuthorAvatar, 8);
                                UIUtils.setTextAndVisibility(this.mAuthorName, this.mArticle.source);
                            }
                            if (this.mArticle.videoWatchCount >= 0) {
                                v0_1 = this.mAppData.videoCellShowPlayCountEnabled == 1 ? 1 : 0;
                                if (v0_1 == 0) {
                                    UIUtils.setVisibility(this.mAuthorVideoWatchCount, 8);
                                } else {
                                    UIUtils.setVisibility(this.mAuthorVideoWatchCount, 0);
                                    v0_1 = this.mArticle.videoWatchCount > 9999 ? 1 : 0;
                                    v2 = this.context;
                                    if (v0_1 != 0) {
                                        v1_2 = this.mArticle.isLiveVideo() ? com.ss.android.article.browser.R.string.video_live_watch_count_wan : com.ss.android.article.browser.R.string.video_watch_count_wan;
                                    } else if (this.mArticle.isLiveVideo()) {
                                        v1_2 = com.ss.android.article.browser.R.string.video_live_watch_count;
                                    } else {
                                        v1_2 = com.ss.android.article.browser.R.string.video_watch_count;
                                    }

                                    Object[] v3 = new Object[1];
                                    v0_1 = v0_1 != 0 ? this.mArticle.videoWatchCount / 10000 : this.mArticle.videoWatchCount;
                                    v3[0] = Integer.valueOf(v0_1);
                                    UIUtils.setTextAndVisibility(this.mAuthorVideoWatchCount, v2.getString(v1_2, v3));
                                }
                            } else {
                                UIUtils.setVisibility(this.mAuthorVideoWatchCount, 8);
                            }

                            UIUtils.setVisibility(this.mAuthorVideoDiggLayout, 8);
                            UIUtils.setVisibility(this.mAuthorVideoBuryLayout, 8);
                            android.support.design.a.a(this.mAuthorVideoCommentCount, this.mArticle.commentCount);
                            UIUtils.setVisibility(this.mAuthorDivider, 8);
                            this.mAuthorVideoAction.setImageResource(com.ss.android.article.browser.R.drawable.more_video_selector);
                            this.mAuthorVideoAction.setPadding(UIUtils.percentWidth(this.context, 0.015625f), 0, UIUtils.percentWidth(this.context, 0.046875f), 0);
                            UIUtils.setLayoutMargins(this.mAuthorVideoAction, ((int) UIUtils.dp2px(this.context, 3f)), -3, -3, -3);
                            this.mAuthorVideoCommentCount.setOnClickListener(this.cA);
                            this.mAuthorVideoAction.setOnClickListener(this.cA);
                            this.mAuthorAvatarWrapper.setOnClickListener(this.cs);
                            this.mAuthorName.setOnClickListener(this.cs);
                            this.mAuthorVideoWatchCount.setOnClickListener(this.cw);
                            UIUtils.setLayoutMargins(this.mDivider, 0, -3, 0, -3);
                            UIUtils.setLayoutParams(this.mDivider, -3, ((int) UIUtils.dp2px(this.context, 11f)));
                            this.mDivider.setBackgroundResource(com.ss.android.article.browser.R.color.ssxinxian1);
                            this.mDivider.setImageResource(com.ss.android.article.browser.R.color.ssxinmian3);
                            v0_1 = ((int) UIUtils.dp2px(this.context, 0.5f));
                            this.mDivider.setPadding(0, v0_1, 0, v0_1);
                        } else if (this.r == 2) {
                            if (this.mNoDiggInfoLayout == null) {
                                this.mNoDiggInfoLayout = ((ViewStub) this.duplicatePressedRelativeLayout.findViewById(com.ss.android.article.browser.R.id.no_digg_info_layout_stub)).inflate();
                                this.mVideoSourceInNoDigg = this.mNoDiggInfoLayout.findViewById(com.ss.android.article.browser.R.id.video_source_in_no_digg);
                                this.mVideoDurationInNoDigg = this.mNoDiggInfoLayout.findViewById(com.ss.android.article.browser.R.id.video_duration_in_no_digg);
                                this.mVideoRepostInNoDigg = this.mNoDiggInfoLayout.findViewById(com.ss.android.article.browser.R.id.video_repost_in_no_digg);
                                this.mVideoCommentInNoDigg = this.mNoDiggInfoLayout.findViewById(com.ss.android.article.browser.R.id.video_comment_in_no_digg);
                                if (this.mIsNightMode) {
                                    super.adaptNoDiggInfoLayoutNightMode();
                                }
                            }

                            this.mNoDiggInfoLayout.setVisibility(View.VISIBLE);
                            this.mVideoSourceInNoDigg.setText(this.mArticle.source);
                            this.mVideoDurationInNoDigg.setText(ArticleHelper.convert2ReadableString(this.mArticle.videoDuration));
                            UIUtils.setVisibility(this.mCoverSource, 8);
                            UIUtils.setVisibility(this.mCoverDuration, 8);
                            android.support.design.a.a(this.mVideoCommentInNoDigg, this.mArticle.commentCount);
                            this.mVideoCommentInNoDigg.setOnClickListener(this.cA);
                            this.mVideoRepostInNoDigg.setOnClickListener(this.cA);
                        } else if (this.r == 3) {
                            if (this.mMoreCommentsDiggInfoLayoutHolder == null) {
                                View moreCommentsDiggInfoLayoutStub = this.duplicatePressedRelativeLayout.findViewById(com.ss.android.article.browser.R.id.more_comments_digg_info_layout_stub);
                                this.mMoreCommentsDiggInfoLayoutHolder = new MoreCommentsDiggInfoLayoutHolder();
                                View moreCommentsDiggInfoLayout = ((ViewStub) moreCommentsDiggInfoLayoutStub).inflate();
                                mMoreCommentsDiggInfoLayoutHolder.mMoreCommentsDiggInfoLayout = (ViewGroup) moreCommentsDiggInfoLayout;
                                mMoreCommentsDiggInfoLayoutHolder.mVideoTitle = moreCommentsDiggInfoLayout.findViewById(com.ss.android.article.browser.R.id.video_title);
                                moreCommentsDiggInfoLayout.findViewById(com.ss.android.article.browser.R.id.actions);
                                mMoreCommentsDiggInfoLayoutHolder.mMultiVideoDiggLayout = moreCommentsDiggInfoLayout.findViewById(com.ss.android.article.browser.R.id.multi_video_digg_layout);
                                mMoreCommentsDiggInfoLayoutHolder.mMultiVideoBuryLayout = moreCommentsDiggInfoLayout.findViewById(com.ss.android.article.browser.R.id.multi_video_bury_layout);
                                int diggLayoutWidth = UIUtils.diggLayoutWidth(moreCommentsDiggInfoLayout.getContext());
                                mMoreCommentsDiggInfoLayoutHolder.mMultiVideoDiggLayout.getLayoutParams().width = diggLayoutWidth;
                                mMoreCommentsDiggInfoLayoutHolder.mMultiVideoBuryLayout.getLayoutParams().width = diggLayoutWidth;
                                mMoreCommentsDiggInfoLayoutHolder.mCommentWrapper = moreCommentsDiggInfoLayout.findViewById(com.ss.android.article.browser.R.id.comment_wrapper);
                                mMoreCommentsDiggInfoLayoutHolder.mComment = moreCommentsDiggInfoLayout.findViewById(com.ss.android.article.browser.R.id.comment);
                                mMoreCommentsDiggInfoLayoutHolder.mMore = moreCommentsDiggInfoLayout.findViewById(com.ss.android.article.browser.R.id.more);
                                mMoreCommentsDiggInfoLayoutHolder.mDividerLine = moreCommentsDiggInfoLayout.findViewById(com.ss.android.article.browser.R.id.divider_line);
                                mMoreCommentsDiggInfoLayoutHolder.mDividerSpace = moreCommentsDiggInfoLayout.findViewById(com.ss.android.article.browser.R.id.divider_space);
                                mMoreCommentsDiggInfoLayoutHolder.mCommentsWrapper = moreCommentsDiggInfoLayout.findViewById(com.ss.android.article.browser.R.id.comments_wrapper);
                                if (this.mIsNightMode) {
                                    super.adaptMoreCommentsDiggInfoLayoutNightMode();
                                }
                            }

                            this.mMoreCommentsDiggInfoLayoutHolder.mMoreCommentsDiggInfoLayout.setVisibility(View.VISIBLE);
                            UIUtils.setTextAndVisibility(this.mMoreCommentsDiggInfoLayoutHolder.mVideoTitle, this.mArticle.title);
                            mMoreCommentsDiggInfoLayoutHolder.mVideoTitle.setEnabled(this.mArticle.clickTimestamp <= 0);
                            this.mMoreCommentsDiggInfoLayoutHolder.mMultiVideoDiggLayout.setText(android.support.design.a.c(this.mArticle.diggCount));
                            this.mMoreCommentsDiggInfoLayoutHolder.mMultiVideoBuryLayout.setText(android.support.design.a.c(this.mArticle.buryCount));
                            android.support.design.a.a(this.mMoreCommentsDiggInfoLayoutHolder.mComment, this.mArticle.commentCount);
                            this.mMoreCommentsDiggInfoLayoutHolder.mMultiVideoDiggLayout.setSelected(this.mArticle.userDigg);
                            this.mMoreCommentsDiggInfoLayoutHolder.mMultiVideoBuryLayout.setSelected(this.mArticle.userBury);
                            this.mMoreCommentsDiggInfoLayoutHolder.mMultiVideoDiggLayout.setOnClickListener(this.cA);
                            this.mMoreCommentsDiggInfoLayoutHolder.mMultiVideoBuryLayout.setOnClickListener(this.cA);
                            this.mMoreCommentsDiggInfoLayoutHolder.mCommentWrapper.setOnClickListener(this.cA);
                            this.mMoreCommentsDiggInfoLayoutHolder.mMore.setOnClickListener(this.cA);
                            if (this.mArticle.comments == null || this.mArticle.comments.size() <= 0) {
                                this.mMoreCommentsDiggInfoLayoutHolder.mCommentsWrapper.setVisibility(View.GONE);
                            } else {
                                this.mMoreCommentsDiggInfoLayoutHolder.mCommentsWrapper.setVisibility(View.VISIBLE);
                                this.mMoreCommentsDiggInfoLayoutHolder.mCommentsWrapper.setOnClickListener(this.cA);
                                Iterator<Comment> iterator = this.mArticle.comments.iterator();
                                while (iterator.hasNext()) {
                                    Comment comment = iterator.next();
                                    if (comment == null) {
                                        continue;
                                    }

                                    if (android.support.design.a.isTextEmpty(comment.text)) {
                                        continue;
                                    }

                                    TextView v2_2 = MoreCommentsDiggInfoLayoutHolder.a(this.context);
                                    SpannableStringBuilder v3_1 = new SpannableStringBuilder();
                                    if (!android.support.design.a.isTextEmpty(comment.userName)) {
                                        String v4 = ((Comment) comment).userName + ":  ";
                                        v3_1.append(v4);
                                        if (foregroundColorSpan == null) {
                                            foregroundColorSpan = new ForegroundColorSpan(ContextCompat.getColor(this.context, com.ss.android.article.browser.R.color.update_comment_more_text_selector));
                                        }

                                        v3_1.setSpan(foregroundColorSpan, 0, v4.length(), 33);
                                    }

                                    v3_1.append(((Comment) comment).text);
                                    v2_2.setText(((CharSequence) v3_1));
                                    this.mMoreCommentsDiggInfoLayoutHolder.mCommentsWrapper.addView(((View) v2_2));
                                    this.mMoreCommentsDiggInfoLayoutHolder.k.add(v2_2);
                                }
                            }

                            if (!this.mCellRef.l) {

                            } else {
                                this.mMoreCommentsDiggInfoLayoutHolder.mDividerSpace.setVisibility(View.GONE);
                                this.mMoreCommentsDiggInfoLayoutHolder.mDividerLine.setVisibility(View.GONE);
                            }
                        } else if (this.r != 6) {

                        } else {
                            this.initVideoSwitchInfosLayout();
                            mediaInfo = this.mArticle.mediaInfo;
                            if (mediaInfo != null) {
                                avatarUrl = mediaInfo.avatarUrl;
                                if (!android.support.design.a.isTextEmpty(avatarUrl)) {
                                    UIUtils.setVisibility(this.mSwitchAvatar, 0);
                                    this.mLargeItemAvatarLoader.loadAvatar(this.mSwitchAvatar, avatarUrl);
                                } else {
                                    UIUtils.setVisibility(this.mSwitchAvatar, 8);
                                }

                                UIUtils.setTextAndVisibility(this.mSwitchName, mediaInfo.name);
                                this.mHeadNameInfosLayout.setOnClickListener(this.cs);
                            } else {
                                UIUtils.setVisibility(this.mSwitchAvatar, 8);
                                UIUtils.setTextAndVisibility(this.mSwitchName, this.mArticle.source);
                                this.mHeadNameInfosLayout.setOnClickListener(null);
                            }

                            this.mSwitchVideoDigg.setSelected(this.mArticle.userDigg);
                            this.mSwitchVideoBury.setSelected(this.mArticle.userBury);
                            this.mSwitchVideoDigg.setText(android.support.design.a.c(this.mArticle.diggCount));
                            this.mSwitchVideoBury.setText(android.support.design.a.c(this.mArticle.buryCount));
                            this.mSwitchVideoCommentCount.setText(android.support.design.a.c(this.mArticle.commentCount), true);
                            this.mSwitchVideoDigg.setOnClickListener(this.cA);
                            this.mSwitchVideoBury.setOnClickListener(this.cA);
                            this.mSwitchVideoCommentCount.setOnClickListener(this.cA);
                            this.mSwitchVideoAction.setOnClickListener(this.cA);
                            this.mVideoSwitchInfosLayout.setVisibility(View.GONE);
                            UIUtils.setLayoutMargins(this.mDivider, 0, -3, 0, -3);
                            UIUtils.setLayoutParams(this.mDivider, -3, ((int) UIUtils.dp2px(this.context, 2f)));
                            this.mDivider.setBackgroundResource(com.ss.android.article.browser.R.color.ssxinmian4);
                        }
                    }

                    label_393:
                    v0_1 = (this.mCellRef.l) || (this.mCellRef.f()) || this.videoStyle == 5 ? 1 : 0;
                    if (!this.mCellRef.l && (this.r == 4 || this.r == 5 || this.r == 6)) {
                        v0_1 = 0;
                    }

                    ImageView v1_6 = this.mDivider;
                    v0_1 = v0_1 != 0 ? 8 : 0;
                    v1_6.setVisibility(v0_1);
                } else if (this.t == 0) {
                    this.mImage3Title.setVisibility(View.GONE);
                    this.k();
                    this.mImage1Container.setVisibility(View.VISIBLE);
                    if (this.cj) {
                        this.initTopSourceLayout();
                        if (this.a(this.mTopSourceLayout, this.mTopSourceIcon, this.mTopSourceIconTv, this.mTopSourceText)) {
                            UIUtils.setLayoutMargins(this.mImage1Container, -3, 0, -3, -3);
                        }
                    }

                    InfoLayout.Info v8 = InfoLayout.Info.acquireInfo();
                    this.g(v8);
                    this.c(v8);
                    this.f(v8);
                    this.e(v8);
                    this.d(v8);
                    this.b(v8);
                    v0_1 = 0;
                    if (this.mAppData.getAbSettings().isFeedPreDrawEnable()) {
                        this.a(this.mImage1Title);
                    } else {
                        TextView v6 = this.mImage1Title;
                        avatarUrl = this.mArticle.title;
                        if (android.support.design.a.isTextEmpty(avatarUrl)) {
                            UIUtils.setVisibility(v6, 8);
                            v0_1 = 1;
                        } else {
                            if (this.ci) {
                                if (this.t == 4 && this.galleryStyle == 0) {
                                } else {
                                    v6.setTextSize(18f);
                                    layoutParams = v6.getLayoutParams();
                                    if (this.t != 0) {
                                        ((LinearLayout.LayoutParams) layoutParams).setMargins(((LinearLayout.LayoutParams) layoutParams).leftMargin, ((int) UIUtils.dp2px(this.context, 10f)), ((LinearLayout.LayoutParams) layoutParams).rightMargin, ((LinearLayout.LayoutParams) layoutParams).bottomMargin);
                                    } else {
                                        ((LinearLayout.LayoutParams) layoutParams).setMargins(((LinearLayout.LayoutParams) layoutParams).leftMargin, ((int) UIUtils.dp2px(this.context, 0f)), ((LinearLayout.LayoutParams) layoutParams).rightMargin, ((LinearLayout.LayoutParams) layoutParams).bottomMargin);
                                    }

                                    TextPaint v0_7 = v6.getPaint();
                                    if (this.mAppData.getAbSettings().isTitleBold()) {
                                        v0_7.setFakeBoldText(true);
                                    } else {
                                        v0_7.setFakeBoldText(false);
                                    }

                                    v6.setLineSpacing(UIUtils.dp2px(this.context, 2f), 1f);
                                }
                            } else {
                                v6.getPaint().setFakeBoldText(false);
                            }

                            this.y();
                            context = this.context;
                            v2_3 = this.mCellRef.title;
                            AppData.isNightMode();
                            v6.setText(a(context, avatarUrl, v2_3));
                            boolean validClickTimestamp = this.mArticle.clickTimestamp <= 0 ? true : false;
                            v6.setEnabled(validClickTimestamp);
                            v6.requestLayout();
                            v0_1 = android.support.design.a.o(this.context) ? com.ss.android.article.base.feature.app.a.b.f : this.mImageViewWidth;
                            int v2_4 = this.mAppData.getAppSettings().isSingleImageGravityChange() ? ((int) UIUtils.dp2px(this.context, 10f)) : ((int) UIUtils.dp2px(this.context, 8f));
                            int v3_2 = TTUtils.getScreenWidth(this.context) - (this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.feed_item_horizontal_margin) << 1) - v0_1 - v2_4;
                            StaticLayout v0_9 = Build.VERSION.SDK_INT >= 16
                                    ? new StaticLayout(avatarUrl, v6.getPaint(), v3_2, Layout.Alignment.ALIGN_NORMAL, v6.getLineSpacingMultiplier(), v6.getLineSpacingExtra(), true)
                                    : new StaticLayout(avatarUrl, v6.getPaint(), v3_2, Layout.Alignment.ALIGN_NORMAL, 1f, 0f, true);
                            v0_1 = v0_9.getLineCount();
                        }
                    }

                    if (this.ch) {
                        this.mDivider.setVisibility(View.GONE);
                        this.h(v8);
                        this.mImage1Title.setMaxLines(2);
                        UIUtils.setLayoutMargins(this.mImage1Container, -3, ((int) UIUtils.dp2px(this.context, 10f)), -3, -3);
                        UIUtils.setLayoutMargins(this.mImage1Container, -3, -3, -3, ((int) UIUtils.dp2px(this.context, 10f)));
                    }

                    if (this.ci) {
                        this.mImage1Title.getViewTreeObserver().addOnPreDrawListener(this.cD);
                        this.h(v8);
                        this.i(v8);
                        UIUtils.setLayoutMargins(this.mDivider, 0, ((int) UIUtils.dp2px(this.context, 0f)), 0, -3);
                        layoutParams = this.mImage1LeftContainer.getLayoutParams();
                        ((RelativeLayout.LayoutParams) layoutParams).addRule(10);
                        this.mImage1LeftContainer.setLayoutParams(layoutParams);
                    } else if (this.mAppData.getAbSettings().isFeedPreDrawEnable()) {
                        this.mImage1Title.getViewTreeObserver().addOnPreDrawListener(this.cC);
                        layoutParams = this.mImage1LeftContainer.getLayoutParams();
                        ((RelativeLayout.LayoutParams) layoutParams).addRule(15);
                        this.mImage1LeftContainer.setLayoutParams(layoutParams);
                        this.mImage1InfoLayout.setVisibility(View.VISIBLE);
                        this.mImage1InfoLayout.setDislikeOnClickListener(this.mDislikeOnClickListener);
                        this.mImage1InfoLayout.setMoreActionClickListener(this.mMoreActionClickListener);
                        this.mImage1InfoLayout.a(v8);
                        UIUtils.setLayoutMargins(this.mDivider, this.itemHorizontalMargin, ((int) UIUtils.dp2px(this.context, 0f)), this.itemHorizontalMargin, -3);
                    } else if (v0_1 > 2) {
                        this.mImage1InfoLayout.setVisibility(View.GONE);
                        this.mImage1InfoLayout.b();
                        this.mImage3InfoLayout.setVisibility(View.VISIBLE);
                        this.mImage3InfoLayout.setDislikeOnClickListener(this.mDislikeOnClickListener);
                        this.mImage3InfoLayout.setMoreActionClickListener(this.mMoreActionClickListener);
                        this.h(v8);
                        this.mImage3InfoLayout.a(v8);
                        this.l();
                        ((ViewGroup.MarginLayoutParams) this.mImage1Container.getLayoutParams()).bottomMargin = 0;
                        layoutParams = this.mImage3InfoLayout.getLayoutParams();
                        if (!this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                            ((ViewGroup.MarginLayoutParams) layoutParams).topMargin = this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.e7);
                        } else if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                            ((ViewGroup.MarginLayoutParams) layoutParams).topMargin = ((int) UIUtils.dp2px(this.context, 5f));
                        } else {
                            ((ViewGroup.MarginLayoutParams) layoutParams).topMargin = ((int) UIUtils.dp2px(this.context, 6f));
                        }
                    } else {
                        this.mImage3InfoLayout.setVisibility(View.GONE);
                        this.mImage3InfoLayout.b();
                        layoutParams = this.mImage1LeftContainer.getLayoutParams();
                        ((RelativeLayout.LayoutParams) layoutParams).addRule(15);
                        this.mImage1LeftContainer.setLayoutParams(layoutParams);
                        this.mImage1InfoLayout.setVisibility(View.VISIBLE);
                        this.mImage1InfoLayout.setDislikeOnClickListener(this.mDislikeOnClickListener);
                        this.mImage1InfoLayout.setMoreActionClickListener(this.mMoreActionClickListener);
                        this.mImage1InfoLayout.a(v8);
                        UIUtils.setLayoutMargins(this.mDivider, this.itemHorizontalMargin, ((int) UIUtils.dp2px(this.context, 0f)), this.itemHorizontalMargin, -3);
                        if (this.mImage1Title.getLineCount() <= 1 && (UIUtils.isVisible(this.mTopSourceLayout))) {
                            this.mImage1Title.setMinLines(2);
                        }
                    }

                    if (!this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                    } else if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                        UIUtils.setLayoutMargins(this.mImage3InfoLayout, -3, ((int) UIUtils.dp2px(this.context, 5f)), -3, ((int) UIUtils.dp2px(this.context, 6f)));
                    } else {
                        UIUtils.setLayoutMargins(this.mImage3InfoLayout, -3, ((int) UIUtils.dp2px(this.context, 6f)), -3, ((int) UIUtils.dp2px(this.context, 7f)));
                    }
                } else {
                    info = InfoLayout.Info.acquireInfo();
                    this.a(this.mImage3Title);
                    if (this.cj) {
                        this.initTopSourceLayout();
                        if (this.a(this.mTopSourceLayout, this.mTopSourceIcon, this.mTopSourceIconTv, this.mTopSourceText)) {
                            UIUtils.setLayoutMargins(this.mImage3Title, -3, 0, -3, -3);
                        }
                    }

                    this.g(info);
                    this.h(info);
                    this.c(info);
                    this.f(info);
                    this.d(info);
                    this.b(info);
                    this.e(info);
                    if (this.ci) {
                        this.i(info);
                        UIUtils.setLayoutMargins(this.mDivider, 0, ((int) UIUtils.dp2px(this.context, 14f)), 0, -3);
                    } else {
                        this.mImage3InfoLayout.setVisibility(View.VISIBLE);
                        this.mImage3InfoLayout.setDislikeOnClickListener(this.mDislikeOnClickListener);
                        this.mImage3InfoLayout.setMoreActionClickListener(this.mMoreActionClickListener);
                        this.mImage3InfoLayout.a(info);
                        UIUtils.setLayoutMargins(this.mDivider, this.itemHorizontalMargin, ((int) UIUtils.dp2px(this.context, 0f)), this.itemHorizontalMargin, -3);
                    }

                    if (this.t == 3) {
                        layoutParams = this.mImage3InfoLayout.getLayoutParams();
                        if (this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                            this.mContentContainer.setMinimumHeight(((int) UIUtils.dp2px(this.context, 30f)));
                            ((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin = this.mAppData.getAppSettings().isMaxCellSpacingChange() ? ((int) UIUtils.dp2px(this.context, 6f)) : ((int) UIUtils.dp2px(this.context, 7f));
                        } else {
                            ((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin = ((int) UIUtils.dp2px(this.context, 16f));
                        }

                        this.mImage3Title.setMaxLines(2);
                    } else if (this.t != 1) {
                    } else {
                        layoutParams = this.mImage3InfoLayout.getLayoutParams();
                        if (this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                            if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                                ((ViewGroup.MarginLayoutParams) layoutParams).topMargin = ((int) UIUtils.dp2px(this.context, 5f));
                            } else {
                                ((ViewGroup.MarginLayoutParams) layoutParams).topMargin = ((int) UIUtils.dp2px(this.context, 6f));
                            }
                        } else {
                            ((ViewGroup.MarginLayoutParams) layoutParams).topMargin = this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.e7);
                        }
                    }
                }
            } else if (this.galleryStyle == 0) {
                UIUtils.setLayoutMargins(this.mImage3Title, -3, ((int) UIUtils.dp2px(this.context, 13f)), -3, -3);
                this.mImage3Title.setMaxLines(2);
                this.a(this.mImage3Title);
                InfoLayout.Info info1 = InfoLayout.Info.acquireInfo();
                this.g(info1);
                this.d(info1);
                this.f(info1);
                this.e(info1);
                this.mImage3InfoLayout.setVisibility(View.VISIBLE);
                this.mImage3InfoLayout.setDislikeOnClickListener(this.mDislikeOnClickListener);
                this.mImage3InfoLayout.setMoreActionClickListener(this.mMoreActionClickListener);
                ((ViewGroup.MarginLayoutParams) this.mImage3InfoLayout.getLayoutParams()).topMargin = this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.e7);
                this.mImage3InfoLayout.a(info1);
                UIUtils.setLayoutParams(this.mDivider, -3, ((int) UIUtils.dp2px(this.context, 11f)));
                UIUtils.setLayoutMargins(this.mDivider, 0, ((int) UIUtils.dp2px(this.context, 14f)), 0, -3);
                this.mDivider.setBackgroundResource(com.ss.android.article.browser.R.color.ssxinxian1);
                this.mDivider.setImageResource(com.ss.android.article.browser.R.color.ssxinmian3);
                v0_1 = ((int) UIUtils.dp2px(this.context, 0.5f));
                this.mDivider.setPadding(0, v0_1, 0, v0_1);
            } else if (this.galleryStyle == 1) {
                this.mImage3Title.setVisibility(View.GONE);
                this.initGridImageLayout();
                this.mGridImageLayout.setVisibility(View.VISIBLE);
                this.mGridLayoutTitle.setVisibility(View.VISIBLE);
                this.a(this.mGridLayoutTitle);
                if (this.cj) {
                    this.initTopSourceLayout();
                    if (this.a(this.mTopSourceLayout, this.mTopSourceIcon, this.mTopSourceIconTv, this.mTopSourceText)) {
                        UIUtils.setLayoutMargins(this.mGridLayoutTitle, -3, 0, -3, -3);
                    }
                }

                info = InfoLayout.Info.acquireInfo();
                this.g(info);
                this.f(info);
                this.d(info);
                this.e(info);
                if (this.ci) {
                    this.h(info);
                    this.a(info);
                    this.i(info);
                    UIUtils.setLayoutMargins(this.mDivider, 0, ((int) UIUtils.dp2px(this.context, 14f)), 0, -3);
                } else {
                    this.mImage3InfoLayout.setVisibility(View.VISIBLE);
                    this.mImage3InfoLayout.setDislikeOnClickListener(this.mDislikeOnClickListener);
                    this.mImage3InfoLayout.setMoreActionClickListener(this.mMoreActionClickListener);
                    this.mImage3InfoLayout.a(info);
                    UIUtils.setLayoutMargins(this.mDivider, this.itemHorizontalMargin, ((int) UIUtils.dp2px(this.context, 0f)), this.itemHorizontalMargin, -3);
                }
            }
            this.s();
            this.q();
            if (this.mArticle == null || !this.z() || this.t == 4 || (this.mCellRef.f()) || this.mCellRef.videoStyle == 5) {
                UIUtils.setVisibility(this.mItemAbstract, 8);
            } else {
                v0_1 = this.mCellRef.title != null && this.mCellRef.title.length != 0 || (this.mCellRef._abstract == null || this.mCellRef._abstract.length <= 0) ? 0 : 1;
                avatarUrl = null;
                AppData.x();
                String v0_10 = v0_1 != 0 || (this.mCellRef.q()) ? this.mArticle._abstract : avatarUrl;
                if (!android.support.design.a.isTextEmpty(v0_10)) {
                    this.initAbstractCommentLayout();
                    this.mAbstractCommentLayout.setVisibility(View.VISIBLE);
                    textView = this.mItemAbstract;
                    v2 = this.context;
                    int[] v3_3 = this.mCellRef._abstract;
                    AppData.isNightMode();
                    textView.setText(a(v2, v0_10, v3_3));
                    textView = this.mItemAbstract;
                    boolean validClickTimestamp = this.mArticle.clickTimestamp <= 0;
                    textView.setEnabled(validClickTimestamp);
                    layoutParams = this.mAbstractCommentLayout.getLayoutParams();
                    if (!this.ci) {
                        ((LinearLayout.LayoutParams) layoutParams).setMargins(((LinearLayout.LayoutParams) layoutParams).leftMargin, 0, ((LinearLayout.LayoutParams) layoutParams).rightMargin, ((int) UIUtils.dp2px(this.context, 14f)));
                    } else if (this.t != 0) {
                        ((LinearLayout.LayoutParams) layoutParams).setMargins(((LinearLayout.LayoutParams) layoutParams).leftMargin, ((int) UIUtils.dp2px(this.context, 14f)), ((LinearLayout.LayoutParams) layoutParams).rightMargin, 0);
                    } else {
                        ((LinearLayout.LayoutParams) layoutParams).setMargins(((LinearLayout.LayoutParams) layoutParams).leftMargin, 0, ((LinearLayout.LayoutParams) layoutParams).rightMargin, ((int) UIUtils.dp2px(this.context, 14f)));
                    }

                    UIUtils.setVisibility(this.mItemAbstract, 0);
                } else {
                    UIUtils.setVisibility(this.mItemAbstract, 8);
                }
            }

            label_203:
            if (this.mArticle.entityStyle > 0 && this.mArticle.entityStyle <= 2 && this.t != 4 && (this.t != 2 || this.r == 0)) {
                if (this.mEntityLayout == null) {
                    this.mEntityLayout = (ViewGroup) ((ViewStub) this.duplicatePressedRelativeLayout.findViewById(com.ss.android.article.browser.R.id.entity_layout_stub)).inflate();
                    this.mEntityDesc = this.mEntityLayout.findViewById(com.ss.android.article.browser.R.id.desc);
                    this.mEntityDivider = this.mEntityLayout.findViewById(com.ss.android.article.browser.R.id.divider);
                    this.mEntityLike = this.mEntityLayout.findViewById(com.ss.android.article.browser.R.id.like);
                    this.mEntityArrow = this.mEntityLayout.findViewById(com.ss.android.article.browser.R.id.arrow);
                    if (this.mIsNightMode) {
                        super.adaptEntityLayoutNightMode();
                    }
                }

                this.mEntityLayout.setVisibility(View.VISIBLE);
                switch (this.mArticle.entityStyle) {
                    case 1: {
                        this.mEntityDivider.setVisibility(View.GONE);
                        this.mEntityLike.setVisibility(View.GONE);
                        this.mEntityArrow.setVisibility(View.VISIBLE);
                        break;
                    }
                    case 2: {
                        this.mEntityDivider.setVisibility(View.VISIBLE);
                        this.mEntityLike.setVisibility(View.VISIBLE);
                        this.mEntityArrow.setVisibility(View.GONE);
                        boolean entityFollowed = this.mArticle.entityFollowed > 0;
                        this.mEntityLike.setSelected(entityFollowed);
                        textView = this.mEntityLike;
                        int entryFollowResId = entityFollowed
                                ? com.ss.android.article.browser.R.string.label_entry_followed
                                : com.ss.android.article.browser.R.string.label_entry_follow;
                        textView.setText(entryFollowResId);
                        this.mEntityLike.setOnClickListener(this.mLikeClickListener);
                        break;
                    }
                }

                if (!this.mFeedItemBehavior.hasSendAction(1, this.mCellRef)) {
                    MobClickCombiner.onEvent(this.context, "like", "list_show", this.mArticle.groupId, 0, this.n());
                    this.mFeedItemBehavior.setSendActionState(1, this.mCellRef, true);
                }

                context = this.context;
                avatarUrl = this.mArticle.entityText;
                v2_3 = this.mArticle.entityMark;
                AppData.isNightMode();
                this.mEntityDesc.setText(a(context, avatarUrl, v2_3, com.ss.android.article.browser.R.color.update_comment_more_text_selector));
                this.mEntityLayout.setOnClickListener(this.cz);
            }

            this.l();
            this.m();
            if (this.mAbstractCommentLayout == null) {
                return;
            }

            if (this.mAbstractCommentLayout.getVisibility() == View.GONE) {
                return;
            }

            if (this.mItemAbstract.getVisibility() != View.GONE) {
                return;
            }

            if (this.mCommentContent.getVisibility() != View.VISIBLE) {
                return;
            }

            if (this.mImage1Container != null) {
                layoutParams = this.mImage1Container.getLayoutParams();
                ((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin = 0;
                this.mImage1Container.setLayoutParams(layoutParams);
            }

            if (this.mImage3InfoLayout.getVisibility() != View.VISIBLE) {
                return;
            }

            layoutParams = this.mImage3InfoLayout.getLayoutParams();
            ((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin = 0;
            this.mImage3InfoLayout.setLayoutParams(layoutParams);
        }
    }

    private void i(InfoLayout.Info info) {
        int v3 = View.GONE;
        if (this.mCellRef.readCount > 0) {
            int v1 = this.mCellRef.readCount;
            String v0 = this.mArticle.h()
                    ? this.context.getString(com.ss.android.article.browser.R.string.l1)
                    : this.context.getString(com.ss.android.article.browser.R.string.rz);
            info.n = android.support.design.a.c(v1) + v0;
            info.a |= 16384;
        }

        if (this.mCellRef.userVerified == 1) {
            info.a |= 2048;
        }

        if (!android.support.design.a.isTextEmpty(this.mCellRef.verifiedContent)) {
            info.l = this.mCellRef.verifiedContent;
            info.a |= 4096;
        }

        if (!android.support.design.a.isTextEmpty(this.mArticle.entityWord)) {
            info.a |= 8192;
            info.m = this.mArticle.entityWord;
        }

        if (!android.support.design.a.isTextEmpty(this.mArticle.tinyToutiaoUrl)) {
            info.tinyTouTiaoUrl = this.mArticle.tinyToutiaoUrl;
            info.a |= 65536;
        }

        if (this.mNewInfoLayout != null) {
            this.mNewInfoLayout.setVisibility(View.VISIBLE);
            if (this.mImage3InfoLayout != null) {
                this.mImage3InfoLayout.setVisibility(v3);
            }

            if (this.mImage1InfoLayout != null) {
                this.mImage1InfoLayout.setVisibility(v3);
            }

            this.mNewInfoLayout.setDislikeOnClickListener(this.mDislikeOnClickListener);
            this.mNewInfoLayout.setSourceOnClickListener(this.cr);
            this.mNewInfoLayout.a(info);
        }
    }

    final void j() {
        if (this.mCellRef != null && this.mArticle != null) {
            this.mArticle.userRepin = false;
            --this.mArticle.repinCount;
            if (this.mArticle.repinCount < 0) {
                this.mArticle.repinCount = 0;
            }

            this.articleActionHelper.a(5, this.mArticle, this.mCellRef.adId);
            this.mFeedItemBehavior.onDeleteFavorClick(this.mCellRef);
        }
    }

    protected final void k() {
        super.k();
        if (this.mImage1InfoLayout != null && this.mImage1InfoLayout.mAvatarLoader == null) {
            this.mImage1InfoLayout.mAvatarLoader = this.mOneOrThreeItemAvatarLoader;
        }
    }

    public final void onMovedToScrapHeap() {
        String v0_6;
        int v0_4;
        ViewGroup.LayoutParams v0_1;
        TextView v0;
        View.OnClickListener v8 = null;
        super.onMovedToScrapHeap();
        this.duplicatePressedRelativeLayout.setOnClickListener(v8);
        if (this.articleShareHelper != null) {
            CallbackCenter.removeCallback(BaseAppData.callbackTypeFeedArticleUmeng, this.cu);
        }
        CallbackCenter.removeCallback(BaseAppData.callbackTypeSpipeItemStateChanged, this.ct);
        if (this.mArticle != null && (this.mArticle.f())) {
            this.networkMonitor.isNetworkOn();
        }

        this.cg = false;
        if (this.mArticle != null && (this.mArticle.userDislike)) {
            v0 = this.t == 0 ? this.mImage1Title : this.mImage3Title;
            this.mImage3Title.setPaintFlags(v0.getPaintFlags() & -17);
        }

        UIUtils.setVisibility(this.mImage3Title, View.VISIBLE);
        if (this.t != -1) {
            if (this.mEntityLayout != null && this.mEntityLayout.getVisibility() != View.GONE) {
                if (this.mAbstractCommentLayout != null && this.mAbstractCommentLayout.getVisibility() == View.VISIBLE) {
                    UIUtils.setLayoutMargins(this.mAbstractCommentLayout, -3, -3, -3, this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.feed_item_vertical_margin));
                } else if (this.mImage3InfoLayout != null && this.mImage3InfoLayout.getVisibility() == View.VISIBLE) {
                    UIUtils.setLayoutMargins(this.mImage3InfoLayout, -3, -3, -3, this.context.getResources().getDimensionPixelOffset(com.ss.android.article.browser.R.dimen.feed_info_layout_margin_bottom));
                } else if (this.mImage1Container == null) {
                } else if (this.mImage1Container.getVisibility() != View.VISIBLE) {
                } else if (this.mImage1InfoLayout == null) {
                } else if (this.mImage1InfoLayout.getVisibility() != View.VISIBLE) {
                } else {
                    UIUtils.setLayoutMargins(this.mImage1Container, -3, -3, -3, this.context.getResources().getDimensionPixelOffset(com.ss.android.article.browser.R.dimen.feed_info_layout_margin_bottom));
                }
            }

            if (this.mAbstractCommentLayout != null && this.mAbstractCommentLayout.getVisibility() != View.GONE) {
                if (this.mItemAbstract.getVisibility() == View.GONE && this.mCommentContent.getVisibility() == View.VISIBLE) {
                    if (this.mImage1Container != null) {
                        v0_1 = this.mImage1Container.getLayoutParams();
                        if (!this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                            ((ViewGroup.MarginLayoutParams) v0_1).bottomMargin = this.resources.getDimensionPixelSize(com.ss.android.article.browser.R.dimen.feed_item_vertical_margin);
                        } else if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                            ((ViewGroup.MarginLayoutParams) v0_1).bottomMargin = ((int) UIUtils.dp2px(this.context, 8f));
                        } else {
                            ((ViewGroup.MarginLayoutParams) v0_1).bottomMargin = ((int) UIUtils.dp2px(this.context, 10f));
                        }

                        this.mImage1Container.setLayoutParams(v0_1);
                    }

                    if (this.mImage3InfoLayout.getVisibility() != View.VISIBLE) {
                    } else {
                        v0_1 = this.mImage3InfoLayout.getLayoutParams();
                        if (!this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                            ((ViewGroup.MarginLayoutParams) v0_1).bottomMargin = this.resources.getDimensionPixelSize(com.ss.android.article.browser.R.dimen.feed_info_layout_margin_bottom);
                        } else if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                            ((ViewGroup.MarginLayoutParams) v0_1).bottomMargin = ((int) UIUtils.dp2px(this.context, 6f));
                        } else {
                            ((ViewGroup.MarginLayoutParams) v0_1).bottomMargin = ((int) UIUtils.dp2px(this.context, 7f));
                        }

                        this.mImage3InfoLayout.setLayoutParams(v0_1);
                    }
                }

                this.mAbstractCommentLayout.setVisibility(View.GONE);
                this.mCommentContent.setOnClickListener(v8);
            }

            if (this.mRightComment != null && this.mRightComment.getVisibility() == View.VISIBLE) {
                this.mRightComment.setVisibility(View.GONE);
            }

            if (this.t == 4) {
                if (this.galleryStyle == 0) {
                    UIUtils.setLayoutMargins(this.mImage3Title, -3, this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.eh), -3, -3);
                    this.mImage3Title.setMaxLines(3);
                    this.mImage3InfoLayout.b();
                    this.mImage3InfoLayout.setVisibility(View.GONE);
                    ((ViewGroup.MarginLayoutParams) this.mImage3InfoLayout.getLayoutParams()).topMargin = this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.feed_info_layout_title_gap);
                    UIUtils.setLayoutParams(this.mDivider, -3, ((int) UIUtils.dp2px(this.context, 0.5f)));
                    this.mDivider.setPadding(0, 0, 0, 0);
                    this.mDivider.setImageDrawable(((Drawable) v8));
                    this.mDivider.setBackgroundResource(com.ss.android.article.browser.R.color.divider);
                    this.Q();
                    if (this.gridImageLayout != null) {
                        this.gridImageLayout.a();
                    }

                    this.mGridImageLayout.setVisibility(View.GONE);
                } else if (this.galleryStyle != 1) {

                } else {
                    if (UIUtils.isVisible(this.mTopSourceLayout)) {
                        UIUtils.setVisibility(this.mTopSourceLayout, View.GONE);
                        this.mTopSourceLayout.setOnClickListener(v8);
                        this.mLargeItemAvatarLoader.clear(this.mTopSourceIcon);
                        if (!this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                            UIUtils.setLayoutMargins(this.mGridLayoutTitle, -3, this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.eh), -3, -3);
                        } else if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                            UIUtils.setLayoutMargins(this.mGridLayoutTitle, -3, ((int) UIUtils.dp2px(this.context, 10f)), -3, -3);
                        } else {
                            UIUtils.setLayoutMargins(this.mGridLayoutTitle, -3, ((int) UIUtils.dp2px(this.context, 12f)), -3, -3);
                        }
                    }

                    this.mGridLayoutTitle.setVisibility(View.GONE);
                    this.mImage3InfoLayout.b();
                    this.mImage3InfoLayout.setVisibility(View.GONE);
                    UIUtils.setLayoutMargins(this.gridImageLayout, 0, -3, 0, -3);
                    UIUtils.setLayoutMargins(this.mDivider, this.itemHorizontalMargin, -3, this.itemHorizontalMargin, -3);
                    this.Q();
                    this.gridImageLayout.a();
                    this.mGridImageLayout.setVisibility(View.GONE);
                }
            } else if (this.t == 2) {
                if (UIUtils.isVisible(this.mTopSourceLayout)) {
                    UIUtils.setVisibility(this.mTopSourceLayout, View.GONE);
                    this.mTopSourceLayout.setOnClickListener(v8);
                    this.mLargeItemAvatarLoader.clear(this.mTopSourceIcon);
                    if (!this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                        UIUtils.setLayoutMargins(this.mImage3Title, -3, this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.eh), -3, -3);
                    } else if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                        UIUtils.setLayoutMargins(this.mImage3Title, -3, ((int) UIUtils.dp2px(this.context, 10f)), -3, -3);
                    } else {
                        UIUtils.setLayoutMargins(this.mImage3Title, -3, ((int) UIUtils.dp2px(this.context, 12f)), -3, -3);
                    }
                }

                if (this.mVideoCoverLayout != null && this.mVideoCoverLayout.getVisibility() == View.VISIBLE) {
                    this.mVideoCoverLayout.setVisibility(View.GONE);
                    this.mVideoCoverLayout.setBackgroundColor(ContextCompat.getColor(this.context, com.ss.android.article.browser.R.color.video_cover_layout_background));
                }

                if (this.mCoverSource != null) {
                    this.mCoverSource.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
                }

                if (this.videoStyle == 5) {
                    this.mMoreCommentsDiggInfoLayoutHolder.mMoreCommentsDiggInfoLayout.setVisibility(View.GONE);
                    this.mCoverTitle.setVisibility(View.VISIBLE);
                    MoreCommentsDiggInfoLayoutHolder v0_2 = this.mMoreCommentsDiggInfoLayoutHolder;
                    v0_2.mMultiVideoDiggLayout.setOnClickListener(v8);
                    v0_2.mCommentWrapper.setOnClickListener(v8);
                    v0_2.mMore.setOnClickListener(v8);
                    v0_2.mMultiVideoBuryLayout.setOnClickListener(v8);
                    v0_2.mDividerSpace.setVisibility(View.VISIBLE);
                    v0_2.mDividerLine.setVisibility(View.VISIBLE);
                    MoreCommentsDiggInfoLayoutHolder.a(v0_2);
                }

                if (this.videoControllerContext != null) {
                    IVideoController v1 = this.videoControllerContext.getVideoController();
                    if (v1 != null && !android.support.design.a.isTextEmpty(this.mArticle.videoId) && (this.mArticle.videoId.equals(v1.getVideoId()))) {
                        if (this.mLargeImageLayout != null) {
                            int[] v0_3 = new int[2];
                            this.mLargeImageLayout.getLocationOnScreen(v0_3);
                            if (this.cq == null) {
                                this.cq = Integer.valueOf(this.context.getResources().getDisplayMetrics().heightPixels);
                            }

                            if (this.cq.intValue() - v0_3[1] >= 600 && v0_3[1] >= -250) {
                                if (v0_3[1] > 0) {
                                    v0_4 = 0;
                                } else {
                                    v0_4 = 1;
                                }
                            } else {
                                v0_4 = 1;
                            }
                        } else {
                            v0_4 = 1;
                        }

                        if (v0_4 == 0) {
                        } else {
                            v1.dismiss(true);
                        }
                    }
                }

                if (this.mLargeImageLayout != null) {
                    if ((this.ck) || this.videoStyle == 5) {
                        v0_1 = this.mLargeImageLayout.getLayoutParams();
                        ((ViewGroup.MarginLayoutParams) v0_1).leftMargin = this.itemHorizontalMargin;
                        ((ViewGroup.MarginLayoutParams) v0_1).rightMargin = this.itemHorizontalMargin;
                        ((ViewGroup.MarginLayoutParams) v0_1).topMargin = this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.ec);
                    }

                    this.mLargeImageLayout.setVisibility(View.GONE);
                    this.mLargeImageLayout.setOnClickListener(v8);
                    this.mLargeImageLayout.setClickable(false);
                    this.mRelatedVideoContainer.setVisibility(View.GONE);
                }

                if (this.r == 0) {
                    this.mImage3InfoLayout.b();
                    this.mImage3InfoLayout.setVisibility(View.GONE);
                    v0_1 = this.mImage3InfoLayout.getLayoutParams();
                    if (!this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                        ((ViewGroup.MarginLayoutParams) v0_1).topMargin = this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.feed_info_layout_title_gap);
                    } else if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                        ((ViewGroup.MarginLayoutParams) v0_1).topMargin = ((int) UIUtils.dp2px(this.context, 5f));
                    } else {
                        ((ViewGroup.MarginLayoutParams) v0_1).topMargin = ((int) UIUtils.dp2px(this.context, 6f));
                    }
                } else if (this.r == 1) {
                    if (this.mDiggInfoLayout != null) {
                        this.mDiggInfoLayout.setVisibility(View.GONE);
                        this.mDiggLayout.setOnClickListener(v8);
                        this.mBuryLayout.setOnClickListener(v8);
                        this.mCoverActionCommentCount.setOnClickListener(v8);
                        this.mCoverActionReport.setOnClickListener(v8);
                    }
                } else if (this.r == 2) {
                    this.mNoDiggInfoLayout.setVisibility(View.GONE);
                    this.mVideoCommentInNoDigg.setOnClickListener(v8);
                    this.mVideoRepostInNoDigg.setOnClickListener(v8);
                } else {
                    if (this.r != 5 && this.r != 4) {
                        if (this.r == 6) {
                            this.mVideoSwitchInfosLayout.setVisibility(View.GONE);
                            this.mLargeItemAvatarLoader.clear(this.mSwitchAvatar);
                            this.mDivider.setVisibility(View.VISIBLE);
                            UIUtils.setLayoutMargins(this.mDivider, this.itemHorizontalMargin, -3, this.itemHorizontalMargin, -3);
                            this.Q();
                            UIUtils.setLayoutParams(this.mDivider, -3, ((int) UIUtils.dp2px(this.context, 0.5f)));
                            this.mDivider.setBackgroundResource(com.ss.android.article.browser.R.color.divider);
                            this.mVideoSwitchSourceInfosLayout.setVisibility(View.GONE);
                            this.mCoverTitle.setTextSize(17f);
                            this.mCoverTitle.setLineSpacing(0f, 1f);
                            this.mSwitchSource.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
                        } else {
                        }
                    } else {
                        this.mDiggAuthorVideoLayout.setVisibility(View.GONE);
                        this.mAuthorVideoAction.setOnClickListener(v8);
                        this.mAuthorVideoCommentCount.setOnClickListener(v8);
                        this.mAuthorVideoBuryLayout.setOnClickListener(v8);
                        this.mAuthorVideoDiggLayout.setOnClickListener(v8);
                        this.mAuthorAvatarWrapper.setOnClickListener(v8);
                        this.mAuthorName.setOnClickListener(v8);
                        this.mAuthorVideoWatchCount.setOnClickListener(v8);
                        this.mCoverTitle.setTextSize(17f);
                        this.mCoverTitle.setTextColor(ContextCompat.getColorStateList(this.context, com.ss.android.article.browser.R.color.article_video_cover_txt_color));
                        UIUtils.setLayoutMargins(this.mDivider, this.itemHorizontalMargin, -3, this.itemHorizontalMargin, -3);
                        this.Q();
                        UIUtils.setLayoutParams(this.mDivider, -3, ((int) UIUtils.dp2px(this.context, 0.5f)));
                        this.mDivider.setPadding(0, 0, 0, 0);
                        this.mDivider.setImageDrawable(((Drawable) v8));
                        this.mDivider.setBackgroundResource(com.ss.android.article.browser.R.color.divider);
                    }
                }

                this.Q();
                UIUtils.setVisibility(this.mLargeImageVideoPlay, View.GONE);
                if (!this.cm || this.videoStyle != 2) {
                    if (this.mLargeVideoTime != null && this.mLargeVideoTime.getVisibility() == View.VISIBLE) {
                        v0_6 = this.mLargeVideoTime.getText();
                        if (v0_6 == null || ((CharSequence) v0_6).length() == 0) {
                            this.mLargeVideoTime.a(com.ss.android.article.base.feature.app.a.b.j, false);
                        }

                        UIUtils.setVisibility(this.mLargeVideoTime, View.GONE);
                    }
                } else if (this.mLargeVideoTime != null && this.mLargeVideoTime.getVisibility() == View.VISIBLE) {
                    UIUtils.setVisibility(this.mLargeVideoTime, View.GONE);
                    DrawableButton v0_5 = this.mLargeVideoTime;
                    Context v1_1 = this.context;
                    AppData.isNightMode();
                    v0_5.setDrawable(ContextCompat.getDrawable(v1_1, com.ss.android.article.browser.R.drawable.palyicon_video_textpage), false);
                }

                if (this.mLargeButtonAd != null && this.mLargeButtonAd.getVisibility() == View.VISIBLE) {
                    this.mLargeButtonAd.d();
                }

                if (this.mCoverButtonAd != null && this.mCoverButtonAd.getVisibility() == View.VISIBLE) {
                    this.mCoverButtonAd.d();
                }

                if (!this.ck) {

                } else {
                    this.a(this.r, false);
                    if (this.mAbstractCommentLayout != null && this.mAbstractCommentLayout.getVisibility() == View.VISIBLE) {
                        ((ViewGroup.MarginLayoutParams) this.mAbstractCommentLayout.getLayoutParams()).bottomMargin = this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.feed_item_vertical_margin);
                    }

                    if (this.mCommentContent == null) {

                    } else if (this.mCommentContent.getVisibility() != View.VISIBLE) {

                    } else {
                        v0_4 = this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.e5);
                        this.mCommentContent.setPadding(v0_4, v0_4, v0_4, this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.a0));
                        v0 = this.mCommentContent;
                        AppData.isNightMode();
                        v0.setBackgroundResource(com.ss.android.article.browser.R.drawable.cq);
                    }
                }
            } else if (this.t == 0) {
                if (UIUtils.isVisible(this.mTopSourceLayout)) {
                    UIUtils.setVisibility(this.mTopSourceLayout, View.GONE);
                    this.mTopSourceLayout.setOnClickListener(v8);
                    this.mLargeItemAvatarLoader.clear(this.mTopSourceIcon);
                    if (!this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                        UIUtils.setLayoutMargins(this.mImage1Container, -3, this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.feed_item_vertical_margin), -3, -3);
                    } else if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                        UIUtils.setLayoutMargins(this.mImage1Container, -3, ((int) UIUtils.dp2px(this.context, 8f)), -3, -3);
                    } else {
                        UIUtils.setLayoutMargins(this.mImage1Container, -3, ((int) UIUtils.dp2px(this.context, 10f)), -3, -3);
                    }

                    if (this.mImage1Title == null) {
                    } else {
                        this.mImage1Title.setMinLines(0);
                    }
                }

                if (this.mImage1Container == null) {
                } else {
                    if (this.mImage1InfoLayout != null && this.mImage1InfoLayout.getVisibility() == View.VISIBLE) {
                        this.mImage1InfoLayout.b();
                        this.mImage1InfoLayout.setVisibility(View.GONE);
                    }

                    if (this.mImage3InfoLayout != null) {
                        this.mImage3InfoLayout.b();
                        this.mImage3InfoLayout.setVisibility(View.GONE);
                    }

                    if (this.mRightVideoTime.getVisibility() == View.VISIBLE) {
                        v0_6 = this.mRightVideoTime.getText();
                        if (v0_6 != null && ((CharSequence) v0_6).length() != 0) {
                        } else {
                            this.mRightVideoTime.a(com.ss.android.article.base.feature.app.a.b.j, false);
                        }
                    }

                    if (this.ch) {
                        this.mImage1Title.setMaxLines(3);
                        v0_4 = this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.feed_info_layout_margin_bottom);
                        if (!this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                            UIUtils.setLayoutMargins(this.mImage1Container, -3, v0_4, -3, v0_4);
                        } else if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                            UIUtils.setLayoutMargins(this.mImage1Container, -3, ((int) UIUtils.dp2px(this.context, 10f)), -3, -3);
                        } else {
                            UIUtils.setLayoutMargins(this.mImage1Container, -3, ((int) UIUtils.dp2px(this.context, 12f)), -3, -3);
                        }
                    }

                    this.mImage1Container.setVisibility(View.GONE);
                    this.mImage1Title.setVisibility(View.VISIBLE);
                    this.mImage1Title.getViewTreeObserver().removeOnPreDrawListener(this.cC);
                    this.Q();
                    if (this.mImage1Title.getLineCount() > 2 && this.mImage3InfoLayout != null) {
                        this.mImage3InfoLayout.b();
                        this.mImage3InfoLayout.setVisibility(View.GONE);
                        v0_1 = this.mImage1Container.getLayoutParams();
                        ViewGroup.LayoutParams v1_2 = this.mImage3InfoLayout.getLayoutParams();
                        if (!this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                            ((ViewGroup.MarginLayoutParams) v0_1).bottomMargin = this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.feed_item_vertical_margin);
                            ((ViewGroup.MarginLayoutParams) v1_2).topMargin = this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.feed_info_layout_title_gap);
                        } else if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                            ((ViewGroup.MarginLayoutParams) v0_1).bottomMargin = ((int) UIUtils.dp2px(this.context, 8f));
                            ((ViewGroup.MarginLayoutParams) v1_2).topMargin = ((int) UIUtils.dp2px(this.context, 5f));
                        } else {
                            ((ViewGroup.MarginLayoutParams) v0_1).bottomMargin = ((int) UIUtils.dp2px(this.context, 10f));
                            ((ViewGroup.MarginLayoutParams) v1_2).topMargin = ((int) UIUtils.dp2px(this.context, 6f));
                        }
                    }

                    if (this.mImage1LeftContainer == null) {

                    } else {
                        v0_1 = this.mImage1LeftContainer.getLayoutParams();
                        if (Build.VERSION.SDK_INT >= 17) {
                            int v1_3 = 15;
                            try {
                                ((RelativeLayout.LayoutParams) v0_1).removeRule(v1_3);
                            } catch (Throwable v1_4) {
                            }
                        }

                        this.mImage1LeftContainer.setLayoutParams(v0_1);
                    }
                }
            } else {
                if (UIUtils.isVisible(this.mTopSourceLayout)) {
                    UIUtils.setVisibility(this.mTopSourceLayout, View.GONE);
                    this.mTopSourceLayout.setOnClickListener(v8);
                    this.mLargeItemAvatarLoader.clear(this.mTopSourceIcon);
                    if (!this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                        UIUtils.setLayoutMargins(this.mImage3Title, -3, this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.eh), -3, -3);
                    } else if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                        UIUtils.setLayoutMargins(this.mImage3Title, -3, ((int) UIUtils.dp2px(this.context, 10f)), -3, -3);
                    } else {
                        UIUtils.setLayoutMargins(this.mImage3Title, -3, ((int) UIUtils.dp2px(this.context, 12f)), -3, -3);
                    }
                }

                this.mImage3InfoLayout.b();
                this.mImage3InfoLayout.setVisibility(View.GONE);
                this.Q();
                if (this.t == 3) {
                    ViewGroup.MarginLayoutParams image3InfoLayoutLp = (ViewGroup.MarginLayoutParams) this.mImage3InfoLayout.getLayoutParams();
                    if (!this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                        image3InfoLayoutLp.bottomMargin = this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.feed_info_layout_margin_bottom);
                    } else if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                        UIUtils.setLayoutMargins(this.mImage3InfoLayout, -3, ((int) UIUtils.dp2px(this.context, 5f)), -3, ((int) UIUtils.dp2px(this.context, 6f)));
                    } else {
                        UIUtils.setLayoutMargins(this.mImage3InfoLayout, -3, ((int) UIUtils.dp2px(this.context, 6f)), -3, ((int) UIUtils.dp2px(this.context, 7f)));
                    }

                    if (this.mImage3Title == null) {
                    } else {
                        this.mImage3Title.setMaxLines(3);
                    }
                } else if (this.t == 1) {
                    ViewGroup.MarginLayoutParams image3InfoLayoutLp = (ViewGroup.MarginLayoutParams) this.mImage3InfoLayout.getLayoutParams();
                    if (!this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                        image3InfoLayoutLp.topMargin = this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.feed_info_layout_title_gap);
                    } else if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                        UIUtils.setLayoutMargins(this.mImage3InfoLayout, -3, ((int) UIUtils.dp2px(this.context, 5f)), -3, ((int) UIUtils.dp2px(this.context, 6f)));
                    } else {
                        UIUtils.setLayoutMargins(this.mImage3InfoLayout, -3, ((int) UIUtils.dp2px(this.context, 6f)), -3, ((int) UIUtils.dp2px(this.context, 7f)));
                    }
                }
            }

            if (this.mEntityLayout != null && this.mEntityLayout.getVisibility() != View.GONE) {
                this.mEntityLayout.setOnClickListener(v8);
                this.mEntityLike.setOnClickListener(v8);
                this.mEntityLayout.setVisibility(View.GONE);
            }

            if (this.t == 1) {
                UIUtils.setVisibility(this.mImage3ImageContainerView, View.GONE);
                if (this.mImage3ImageContainerView != null && this.mImage3ImageContainerView.getVisibility() == View.VISIBLE && this.mImage3ImageViews != null) {
                    for (v0_4 = 0; v0_4 < 3; ++v0_4) {
                        ArticleHelper.b(this.mImage3ImageViews[v0_4]);
                    }
                }
            } else if (this.t == 0) {
                ArticleHelper.b(this.mImage1ImageView);
            } else if (this.t == 2) {
                if (this.ck) {
                    UIUtils.setVisibility(this.mCoverTopShaow, View.GONE);
                    UIUtils.setVisibility(this.mCoverBottomShaow, View.GONE);
                }

                ArticleHelper.b(this.mLargeImage);
                UIUtils.setVisibility(this.mLargeImageVideoGrayArea, View.GONE);
            }

            this.Q();
        }
    }

    final void l() {
        if (this.mEntityLayout != null && this.mEntityLayout.getVisibility() != View.GONE) {
            if (this.mAbstractCommentLayout != null && this.mAbstractCommentLayout.getVisibility() == View.VISIBLE) {
                UIUtils.setLayoutMargins(this.mAbstractCommentLayout, -3, -3, -3, 0);
                return;
            }

            if (this.mImage3InfoLayout != null && this.mImage3InfoLayout.getVisibility() == View.VISIBLE) {
                UIUtils.setLayoutMargins(this.mImage3InfoLayout, -3, -3, -3, 0);
                return;
            }

            if (this.mImage1Container == null) {
                return;
            }

            if (this.mImage1Container.getVisibility() != View.VISIBLE) {
                return;
            }

            if (this.mImage1InfoLayout == null) {
                return;
            }

            if (this.mImage1InfoLayout.getVisibility() != View.VISIBLE) {
                return;
            }

            UIUtils.setLayoutMargins(this.mImage1Container, -3, -3, -3, 0);
        }
    }

    final void m() {
        Comment v0_2;
        int v9 = com.ss.android.article.browser.R.color.ssxinzi2;
        int v10 = 33;
        int v6 = View.GONE;
        if (!this.A() || this.videoStyle == 5 || this.t == 4) {
            label_26:
            UIUtils.setVisibility(this.mCommentContent, v6);
        } else {
            if (this.videoStyle == 9 && (mVideoSwitchInfosLayout == null || mVideoSwitchInfosLayout.getVisibility() == v6)) {
                UIUtils.setVisibility(this.mCommentContent, v6);
                return;
            } else if (this.mEntityLayout != null && this.mEntityLayout.getVisibility() == View.VISIBLE) {
                UIUtils.setVisibility(this.mCommentContent, v6);
                return;
            }

            AppData.isNightMode();
            int v1 = this.mArticle.zzcomment == null || (this.mArticle.zzcomment.isEmpty()) ? 0 : 1;
            int v4 = this.mArticle.comment != null ? 1 : 0;
            if (v1 == 0 && v4 == 0) {
                UIUtils.setVisibility(this.mCommentContent, v6);
                return;
            }

            if (this.v) {
                this.mRightComment.setVisibility(View.VISIBLE);
                this.mRightComment.setOnClickListener(this.cv);
                if (this.mCommentContent.getVisibility() == View.VISIBLE) {
                    UIUtils.setVisibility(this.mCommentContent, v6);
                }
            } else {
                this.initAbstractCommentLayout();
                UIUtils.setVisibility(this.mRightComment, v6);
                this.mCommentContent.setOnClickListener(this.cv);
                this.mAbstractCommentLayout.setVisibility(View.VISIBLE);
                UIUtils.setVisibility(this.mCommentContent, 0);
            }

            LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) this.mAbstractCommentLayout.getLayoutParams();
            if (!this.ci) {
                lp.setMargins(((LinearLayout.LayoutParams) lp).leftMargin, 0, ((LinearLayout.LayoutParams) lp).rightMargin, ((int) UIUtils.dp2px(this.context, 14f)));
            } else if (this.t != 0) {
                lp.setMargins(((LinearLayout.LayoutParams) lp).leftMargin, ((LinearLayout.LayoutParams) lp).topMargin, ((LinearLayout.LayoutParams) lp).rightMargin, 0);
            } else {
                lp.setMargins(((LinearLayout.LayoutParams) lp).leftMargin, 0, ((LinearLayout.LayoutParams) lp).rightMargin, ((int) UIUtils.dp2px(this.context, 14f)));
            }

            if (v1 != 0) {
                v0_2 = this.mArticle.zzcomment.get(0);
            } else if (v4 != 0) {
                v0_2 = this.mArticle.comment;
            } else {
                return;
            }

            StringBuilder v5 = new StringBuilder();
            if (v1 == 0 || (TextUtils.isEmpty(v0_2.mediaName))) {
                if (!android.support.design.a.isTextEmpty(v0_2.userName)) {
                    v5.append(v0_2.userName);
                    v4 = v5.length();
                    if (v0_2.userVerified) {
                        v5.append("v");
                    }

                    v5.append(": ");
                    v1 = v5.length();
                } else {
                    v1 = 0;
                    v4 = 0;
                }
            } else {
                v5.append(v0_2.mediaName);
                v4 = v5.length();
                if (v0_2.userVerified) {
                    v5.append("v");
                }

                v5.append(this.context.getString(com.ss.android.article.browser.R.string.list_comment_foward_tag));
                v1 = v5.length();
            }

            if (v0_2.text != null) {
                v5.append(v0_2.text);
            }

            if (v4 > 0) {
                SpannableString v6_1 = new SpannableString(v5.toString());
                if (this.ci) {
                    v6_1.setSpan(new ForegroundColorSpan(this.resources.getColor(com.ss.android.article.browser.R.color.ssxinzi1)), 0, v1, v10);
                    v6_1.setSpan(new ForegroundColorSpan(this.resources.getColor(com.ss.android.article.browser.R.color.ssxinzi3)), v1, v5.length(), v10);
                } else {
                    this.mCommentContent.setTextColor(this.resources.getColor(v9));
                }

                if (v0_2.userVerified) {
                    v6_1.setSpan(new com.ss.android.article.base.ui.k(this.context), v4, v4 + 1, v10);
                }

                if ((this.ci) && this.t == 0 && this.mImage1Title != null && this.mImage1Title.getLineCount() == 1) {
                    if (this.mRightComment != null) {
                        this.mRightComment.setText(v6_1);
                    } else {
                    }
                } else {
                    this.mCommentContent.setText(v6_1);
                }
            } else {
                if ((this.ci) && this.t == 0 && this.mImage1Title != null && this.mImage1Title.getLineCount() == 1) {
                    if (this.mRightComment != null) {
                        this.mRightComment.setTextColor(this.resources.getColor(v9));
                        this.mRightComment.setText(v5.toString());
                    } else {
                    }
                } else {
                    this.mCommentContent.setTextColor(this.resources.getColor(v9));
                    this.mCommentContent.setText(v5.toString());
                }
            }

            if (this.t != 2) {
                return;
            }

            if (!this.mCellRef.f()) {
                return;
            }

            this.a(this.r, true);
            this.mCommentContent.setPadding(0, 0, 0, this.context.getResources().getDimensionPixelSize(com.ss.android.article.browser.R.dimen.e6));
            this.mCommentContent.setBackgroundResource(0);
            ((ViewGroup.MarginLayoutParams) this.mAbstractCommentLayout.getLayoutParams()).bottomMargin = 0;
        }
    }

    public final View m_() {
        return this.mLargeImageLayout;
    }

    final JSONObject n() {
        int v0_1;
        JSONObject v1 = new JSONObject();
        try {
            v1.put("source", this.mFeedItemBehavior.getCategoryName());
            if (this.mArticle.entityStyle == 2) {
                v0_1 = 1;
            } else {
                v0_1 = 0;
            }
            v1.put("like", v0_1);
            v1.put("item_id", this.mArticle.itemId);
            v1.put("keyword", this.mArticle.entityWord);
        } catch (JSONException v0) {
            Logger.throwExceptionInDebug(v0);
        }

        return v1;
    }

    public final void o() {
        if (this.videoControllerContext != null && this.videoControllerContext.getVideoController() != null && this.mArticle != null) {
            if (!NetworkUtils.isNetworkAvailable(this.context)) {
                UIUtils.showImageToast(this.context, com.ss.android.article.browser.R.drawable.close_popup_textpage, com.ss.android.article.browser.R.string.net_unvailable);
            } else {
                if (!NetworkUtils.isWifi(this.context) && !this.mAppData.userAllowUseMobileNet) {
                    AlertDialog.Builder v2 = com.ss.android.j.b.createDialogBuilder(this.context);
                    long v8 = -1;
                    long v6 = -1;
                    if (this.mCellRef != null) {
                        v8 = this.mCellRef.getAdId();
                        Article v3 = this.mCellRef.article;
                        if (v3 != null) {
                            v6 = v3.groupId;
                        }
                    }

                    final Context v5 = this.context;
                    v2.setMessage(com.ss.android.article.browser.R.string.video_mobile_play_dlg_content);
                    final long finalV2 = v6;
                    final long finalV3 = v8;
                    v2.setPositiveButton(com.ss.android.article.browser.R.string.video_mobile_play, new DialogInterface.OnClickListener() {

                        public final void onClick(DialogInterface dialogInterface, int arg10) {
                            mAppData.userAllowUseMobileNet = true;
                            p();
                            MobClickCombiner.onEvent(v5, "video", "net_alert_confirm", finalV2, finalV3);
                        }
                    });
                    final long finalV = v6;
                    final long finalV1 = v8;
                    v2.setNegativeButton(com.ss.android.article.browser.R.string.video_mobile_stop, new DialogInterface.OnClickListener() {

                        public final void onClick(DialogInterface arg9, int arg10) {
                            MobClickCombiner.onEvent(v5, "video", "net_alert_cancel", finalV, finalV1);
                        }
                    });
                    MobClickCombiner.onEvent(v5, "video", "net_alert_show", v6, v8);
                    v2.setCancelable(false);
                    v2.show();
                    return;
                }

                this.p();
            }
        }
    }

    final void p() {
        if (this.videoControllerContext != null) {
            IVideoController v0 = this.videoControllerContext.getVideoController();
            if (v0 != null && this.mArticle != null && !android.support.design.a.isTextEmpty(this.mArticle.videoId) && (this.videoControllerContext.isStreamTab())) {
                this.videoControllerContext.initVideoView();
                this.mAppData.article = this.mArticle;
                int v2 = this.actualLargeImageWidth;
                int v3 = this.mLargeImage.getHeight();
                if (this.mArticle.videoId.equals(v0.getVideoId())) {
                    this.t();
                } else {
                    v0.play(this.mCellRef, v2, v3, this.mLargeImage, this.mRelatedVideoContainer, false);
                    v0.setPlayCompleteListener(this.mPlayCompleteListener);
                }
            }
        }
    }

    private void q() {
        String v0_4;
        boolean isAd;
        ViewGroup.LayoutParams v0_2;
        ImageInfo v1_2;
        Object v0_1;
        int v6;
        int v5;
        int v0;
        int v13 = -3;
        Drawable v2 = null;
        int v12 = View.GONE;
        this.cp = false;
        if (this.t == 4) {
            this.initGridImageLayout();
            this.mGridImageLayout.setVisibility(View.VISIBLE);
            v0 = this.mArticle.gallaryImageCount;
            if (v0 < this.mArticle.imageList.size()) {
                v0 = this.mArticle.imageList.size();
            }

            if (this.mCellRef.galleryStyle == 1) {
                UIUtils.setLayoutMargins(this.gridImageLayout, this.itemHorizontalMargin, v13, this.itemHorizontalMargin, v13);
            }

            GridImageLayout v1 = this.gridImageLayout;
            List v2_1 = this.mArticle.imageList;
            v5 = this.mArticle.gallaryFlag;
            v6 = this.galleryStyle;
            v1.j.clear();
            if (v2_1 != null && v2_1.size() > 0) {
                v1.j.addAll(((Collection) v2_1));
            }

            v1.k = v5;
            v1.g = v6;
            if (v1.j.size() < 3 && v1.k != 1) {
                v1.k = 1;
            }

            if (v1.k <= 0 || v1.k > 3) {
                v1.k = 1;
            }

            v1.d.setText(String.format(v1.e, Integer.valueOf(v0)));
            switch (v1.k) {
                case 1: {
                    v1.b.setVisibility(v12);
                    v1.c.setVisibility(v12);
                    ArticleHelper.setVisible(v1.a, (ImageInfo) v1.j.get(0));
                    break;
                }
                case 2: {
                    v1.b.setVisibility(View.VISIBLE);
                    v1.c.setVisibility(View.VISIBLE);
                    ArticleHelper.setVisible(v1.a, (ImageInfo) v1.j.get(0));
                    ArticleHelper.setVisible(v1.b, (ImageInfo) v1.j.get(1));
                    ArticleHelper.setVisible(v1.c, (ImageInfo) v1.j.get(2));
                    break;
                }
                case 3: {
                    v1.b.setVisibility(View.VISIBLE);
                    v1.c.setVisibility(View.VISIBLE);
                    ArticleHelper.setVisible(v1.b, (ImageInfo) v1.j.get(0));
                    ArticleHelper.setVisible(v1.a, (ImageInfo) v1.j.get(1));
                    ArticleHelper.setVisible(v1.c, (ImageInfo) v1.j.get(2));
                    break;
                }
            }

            if (!this.ce.get()) {
                this.loadImage();
                this.cg = false;
                return;
            }

            this.cg = true;
        } else {
            if (this.t == 1) {
                if (this.mArticle.imageList != null && !this.mArticle.imageList.isEmpty()) {
                    this.initMultiImageLayout();
                    UIUtils.setVisibility(this.mImage3ImageContainerView, 0);
                    v6 = this.mArticle.imageList.size();
                    v0_1 = this.mArticle.imageList.get(0);
                    Object v5_1 = v0_1 == null || v6 <= 1 ? null : this.mArticle.imageList.get(1);
                    if (v5_1 == null || v6 <= 2) {
                        v1_2 = ((ImageInfo) null);
                    } else {
                        v1_2 = (ImageInfo) this.mArticle.imageList.get(2);
                    }

                    ArticleHelper.setVisible(this.mImage3FirstImageView, ((ImageInfo) v0_1));
                    ArticleHelper.setVisible(this.mImage3SecondImageView, ((ImageInfo) v5_1));
                    ArticleHelper.setVisible(this.mImage3ThirdImageView, v1_2);
                    if (!this.ce.get()) {
                        this.loadImage();
                        this.cg = false;
                        return;
                    }

                    this.cg = true;
                    return;
                }

                UIUtils.setVisibility(this.mImage3ImageContainerView, v12);
                return;
            }

            if (this.t == 0) {
                boolean v5_2 = this.ce.get();
                v0_2 = this.mImage1ImageView.getLayoutParams();
                isAd = AppData.getInstance().getAbSettings().isLoadImage4G();
                NetworkType v6_1 = this.networkMonitor.mCurrrentNetworkType;
                int v1_4 = !isAd || v6_1 != NetworkType.MOBILE_4G ? 0 : 1;
                if (android.support.design.a.o(this.context)) {
                    v0_2.width = com.ss.android.article.base.feature.app.a.b.f;
                    v0_2.height = com.ss.android.article.base.feature.app.a.b.g;
                } else {
                    v0_2.width = this.mImageViewWidth;
                    v0_2.height = this.mImageViewHeight;
                }

                FeedCellStyleConfig.a(this.mImage1ImageView);
                this.mImage1ImageView.setLayoutParams(v0_2);
                ImageInfo v0_3 = this.mArticle.middleImage;
                if (v0_3 == null && this.mArticle.imageList != null && !this.mArticle.imageList.isEmpty()) {
                    v0_1 = this.mArticle.imageList.get(0);
                }

                if (this.mArticle.h()) {
                    UIUtils.setVisibility(this.mRightVideoTime, 0);
                    if (!this.mArticle.isLiveVideo()) {
                        this.mRightVideoTime.setDrawable(this.resources.getDrawable(com.ss.android.article.browser.R.drawable.palyicon_video_textpage), false);
                        if (this.mArticle.videoDuration > 0) {
                            this.mRightVideoTime.setText(ArticleHelper.convert2ReadableString(this.mArticle.videoDuration), true);
                        } else {
                            this.mRightVideoTime.setText("", false);
                            this.mRightVideoTime.a(com.ss.android.article.base.feature.app.a.b.i, true);
                        }
                    } else {
                        this.mRightVideoTime.setDrawable(ContextCompat.getDrawable(this.context, com.ss.android.article.browser.R.drawable.live_video_tip), true);
                        this.mRightVideoTime.setText(this.context.getString(com.ss.android.article.browser.R.string.live_video_tip), true);
                    }
                } else {
                    if (this.mArticle.gallaryImageCount > 1 && this.networkMonitor != null && !this.networkMonitor.isWifiOn() && v1_4 == 0) {
                        UIUtils.setVisibility(this.mRightVideoTime, 0);
                        this.mRightVideoTime.setDrawable(v2, false);
                        this.mRightVideoTime.setText(this.resources.getString(com.ss.android.article.browser.R.string.n1, new Object[]{Integer.valueOf(this.mArticle.gallaryImageCount)}), true);
                    } else {
                        UIUtils.setVisibility(this.mRightVideoTime, v12);
                    }
                }

                label_226:
                if (v0_3 != null) {
                    ArticleHelper.setVisible(this.mImage1ImageView, v0_3);
                    UIUtils.setVisibility(this.mImage1ImageView, 0);
                } else {
                    UIUtils.setVisibility(this.mImage1ImageView, v12);
                }

                if (!v5_2) {
                    this.loadImage();
                    this.cg = false;
                    return;
                }

                this.cg = true;
                return;
            }

            if (this.t != 2) {
                return;
            }

            boolean v6_2 = this.ce.get();
            isAd = this.mCellRef.adId > 0 ? true : false;
            this.initLargeImageLayout();
            this.mLargeImageLayout.setVisibility(View.VISIBLE);
            this.mLargeImageLayout.setClickable(false);
            v5 = -1;
            if (this.mCellRef.g()) {
                this.mLargeImageLayout.setOnClickListener(this.cB);
                switch (this.mCellRef.videoStyle) {
                    case 2: {
                        UIUtils.setVisibility(this.mLargeImageVideoPlay, 0);
                        if (this.mCellRef.article != null && this.mCellRef.article.aF != null && ((this.mCellRef.article.aF instanceof FeedDownloadAppAd))) {
                            if (((FeedDownloadAppAd) this.mCellRef.article.aF).uiType == 0) {
                                this.mLargeButtonAd.a(this.mCellRef);
                            } else {
                                UIUtils.setVisibility(this.mLargeImageVideoGrayArea, 0);
                                UIUtils.setVisibility(this.mLargeButtonAd, v12);
                            }
                        }

                        LargeVideoGrayAreaLayout v7 = this.mLargeImageVideoGrayArea;
                        CellRef v0_5 = this.mCellRef;
                        if (v0_5 != null && v0_5.article != null) {
                            v7.e = v0_5;
                            BaseAdsData v0_6 = v0_5.article.aF;
                            if (v0_6 != null && ((v0_6 instanceof FeedDownloadAppAd)) && v0_6.id > 0) {
                                v7.mFeedDownloadAppAd = ((FeedDownloadAppAd) v0_6);
                                if (android.support.design.a.isTextEmpty(v7.mFeedDownloadAppAd.buttonText)) {
                                    if ("app".equals(v7.mFeedDownloadAppAd.type)) {
                                        v7.mFeedDownloadAppAd.buttonText = v7.mContext.getResources().getString(com.ss.android.article.browser.R.string.j2);
                                    } else if ("action".equals(v7.mFeedDownloadAppAd.type)) {
                                        v7.mFeedDownloadAppAd.buttonText = v7.mContext.getResources().getString(com.ss.android.article.browser.R.string.call_now);
                                    } else if ("web".equals(v7.mFeedDownloadAppAd.type)) {
                                        v7.mFeedDownloadAppAd.buttonText = v7.mContext.getResources().getString(com.ss.android.article.browser.R.string.ad_label_detail);
                                    }
                                }

                                if ("app".equals(v7.mFeedDownloadAppAd.type)) {
                                    if (!AppData.getInstance().allowInsideDownloadManager()) {
                                    } else {

                                        if (v7.f != null) {
                                            DownloadAdapterProxy.inst().unregisterDownloadListener(v7.mContext, Long.valueOf(v7.f.id), v7.h);
                                        }

                                        if (v7.g != null && v7.g.getStatus() != AsyncTask.Status.FINISHED) {
                                            v7.g.cancel(true);
                                        }

                                        v7.g = new com.ss.android.article.base.ui.LargeVideoGrayAreaLayout.b(v7);
                                        com.bytedance.common.utility.b.a.a(v7.g, new String[]{v7.mFeedDownloadAppAd.downloadUrl});
                                    }
                                } else {
                                    v7.a();
                                }
                            }
                        }

                        this.mLargeImageVideoPlay.setOnClickListener(this.cB);
                        if (this.mArticle.videoDuration > 0) {
                            UIUtils.setVisibility(this.mLargeVideoTime, 0);
                            this.mLargeVideoTime.setText(ArticleHelper.convert2ReadableString(this.mArticle.videoDuration), false);
                            this.mLargeVideoTime.setDrawable(v2, true);
                        }

                        if (this.mArticle.isLiveVideo()) {
                            this.mLargeVideoTime.setDrawable(ContextCompat.getDrawable(this.context, com.ss.android.article.browser.R.drawable.live_video_tip), true);
                            this.mLargeVideoTime.setText(this.context.getString(com.ss.android.article.browser.R.string.live_video_tip), true);
                            this.mLargeImageVideoPlay.setImageResource(com.ss.android.article.browser.R.drawable.media_pause_icon_live_selector);
                            v0 = v5;
                            break;
                        }

                        if (UIUtils.isVisible(this.mLargeVideoTime)) {
                            this.mLargeVideoTime.setDrawable(v2, true);
                        }

                        this.mLargeImageVideoPlay.setImageResource(com.ss.android.article.browser.R.drawable.playicon_video_selector);
                        v0 = v5;
                        break;
                    }
                    case 5: {
                        this.initVideoCoverLayout();
                        UIUtils.setVisibility(this.mVideoCoverLayout, 0);
                        if (this.mFeedItemBehavior.contextType() != 1) {
                            this.mVideoCoverLayout.setBackgroundColor(0);
                        }

                        this.mCoverTitle.setVisibility(v12);
                        v0_4 = ArticleHelper.convert2ReadableString(this.mArticle.videoDuration);
                        if (this.mArticle.videoDuration == 0) {
                            this.mCoverDuration.setVisibility(v12);
                        } else {
                            this.mCoverDuration.setVisibility(View.VISIBLE);
                            this.mCoverDuration.setText(v0_4, true);
                        }

                        this.mCoverButtonAd.a(this.mCellRef);
                        if (this.mArticle.isLiveVideo()) {
                            UIUtils.setVisibility(this.mCoverDuration, 0);
                            this.mCoverDuration.setDrawable(ContextCompat.getDrawable(this.context, com.ss.android.article.browser.R.drawable.live_video_tip), true);
                            this.mCoverDuration.setText(this.context.getString(com.ss.android.article.browser.R.string.live_video_tip), true);
                            this.mCoverPlayIcon.setImageResource(com.ss.android.article.browser.R.drawable.media_pause_icon_live_selector);
                        } else {
                            if (UIUtils.isVisible(this.mCoverDuration)) {
                                this.mCoverDuration.setDrawable(v2, true);
                            }

                            this.mCoverPlayIcon.setImageResource(com.ss.android.article.browser.R.drawable.playicon_video_selector);
                        }

                        v0 = ArticleHelper.getActualLargeImageHeight(this.mArticle.largeImageList, UIUtils.getScreenWidth(this.context), isAd, this.maxLargeImageHeight);
                        if (this.cn) {
                            this.mCoverSource.setVisibility(View.VISIBLE);
                            this.mCoverSource.setText("");
                            this.mCoverSource.setCompoundDrawablesWithIntrinsicBounds(com.ss.android.article.browser.R.drawable.u7, 0, 0, 0);
                            break;
                        }

                        this.mCoverSource.setVisibility(v12);
                        break;
                    }
                    case 3:
                    case 4:
                    case 6:
                    case 7:
                    case 8:
                    case 9: {
                        this.initVideoCoverLayout();
                        UIUtils.setVisibility(this.mVideoCoverLayout, 0);
                        UIUtils.setTextAndVisibility(this.mCoverTitle, this.mArticle.title);
                        if (this.r == 5 || this.r == 4) {
                            this.mCoverTitle.setTextSize(16f);
                            this.mCoverTitle.setTextColor(ContextCompat.getColorStateList(this.context, com.ss.android.article.browser.R.color.ssxinzi10));
                        } else if (this.r == 6) {
                            this.mCoverTitle.setTextSize(15f);
                            this.mCoverTitle.setLineSpacing(UIUtils.dp2px(this.context, 6f), 1f);
                        }

                        if (this.r == 1 || this.r == 4 || this.r == 5) {
                            v0_4 = ArticleHelper.convert2ReadableString(this.mArticle.videoDuration);
                            if (this.mArticle.videoDuration == 0) {
                                this.mCoverDuration.setVisibility(v12);
                            } else {
                                this.mCoverDuration.setVisibility(View.VISIBLE);
                                this.mCoverDuration.setText(v0_4, true);
                            }

                            this.mCoverButtonAd.a(this.mCellRef);
                        } else {
                            UIUtils.setVisibility(this.mCoverSource, v12);
                            UIUtils.setVisibility(this.mCoverDuration, v12);
                        }

                        if (this.r == 6) {
                            if (this.mVideoSwitchSourceInfosLayout == null) {
                                this.mVideoSwitchSourceInfosLayout = (ViewGroup) ((ViewStub) this.mVideoCoverLayout.findViewById(com.ss.android.article.browser.R.id.video_switch_source_infos_stub)).inflate();
                                this.mSwitchSource = this.mVideoSwitchSourceInfosLayout.findViewById(com.ss.android.article.browser.R.id.switch_source);
                                this.mCommentCount = this.mVideoSwitchSourceInfosLayout.findViewById(com.ss.android.article.browser.R.id.comment_count);
                                this.mVideoDuration = this.mVideoSwitchSourceInfosLayout.findViewById(com.ss.android.article.browser.R.id.video_duration);
                                if (this.mIsNightMode) {
                                    super.adaptVideoSwitchInfosLayoutNightMode();
                                }
                            }

                            this.mVideoSwitchSourceInfosLayout.setVisibility(View.VISIBLE);
                            v0_4 = ArticleHelper.convert2ReadableString(this.mArticle.videoDuration);
                            if (this.mArticle.videoDuration == 0) {
                                this.mVideoDuration.setVisibility(v12);
                            } else {
                                this.mVideoDuration.setVisibility(View.VISIBLE);
                                this.mVideoDuration.setText(((CharSequence) v0_4));
                            }

                            this.mCommentCount.setText(android.support.design.a.c(this.mArticle.videoWatchCount) + this.context.getString(com.ss.android.article.browser.R.string.video_play_prefix) + "  " + android.support.design.a.c(this.mArticle.commentCount) + this.context.getString(com.ss.android.article.browser.R.string.comment_prefix));
                            UIUtils.setTextAndVisibility(this.mSwitchSource, this.mArticle.source);
                        }

                        if (this.mFeedItemBehavior.contextType() != 1) {
                            this.mVideoCoverLayout.setBackgroundColor(0);
                        }

                        if (this.mArticle.isLiveVideo()) {
                            UIUtils.setVisibility(this.mCoverDuration, 0);
                            this.mCoverDuration.setDrawable(ContextCompat.getDrawable(this.context, com.ss.android.article.browser.R.drawable.live_video_tip), true);
                            this.mCoverDuration.setText(this.context.getString(com.ss.android.article.browser.R.string.live_video_tip), true);
                            this.mCoverPlayIcon.setImageResource(com.ss.android.article.browser.R.drawable.media_pause_icon_live_selector);
                        } else {
                            if (UIUtils.isVisible(this.mCoverDuration)) {
                                this.mCoverDuration.setDrawable(v2, true);
                            }

                            this.mCoverPlayIcon.setImageResource(com.ss.android.article.browser.R.drawable.playicon_video_selector);
                        }

                        this.mCoverPlayIcon.setOnClickListener(this.cB);
                        v0 = ArticleHelper.getActualLargeImageHeight(
                                this.mArticle.largeImageList,
                                UIUtils.getScreenWidth(this.context),
                                isAd,
                                this.maxLargeImageHeight);
                        if (!this.cn) {
                            break;
                        }

                        if (this.r == 6) {
                            if (this.mSwitchSource.getVisibility() == v12) {
                                this.mSwitchSource.setVisibility(View.VISIBLE);
                                this.mSwitchSource.setText("");
                            }

                            this.mSwitchSource.setCompoundDrawablesWithIntrinsicBounds(com.ss.android.article.browser.R.drawable.u7, 0, 0, 0);
                            break;
                        }

                        if (this.mCoverSource.getVisibility() == v12) {
                            this.mCoverSource.setVisibility(View.VISIBLE);
                            this.mCoverSource.setText("");
                        }

                        this.mCoverSource.setCompoundDrawablesWithIntrinsicBounds(com.ss.android.article.browser.R.drawable.u7, 0, 0, 0);
                        break;
                    }
                    default: {
                        v0 = v5;
                        break;
                    }
                }

                label_320:
                this.cp = true;
            } else {
                if (this.mArticle.h()) {
                    UIUtils.setVisibility(this.mLargeVideoTime, 0);
                    if (this.mArticle.videoDuration > 0) {
                        this.mLargeVideoTime.setText(ArticleHelper.convert2ReadableString(this.mArticle.videoDuration), true);
                    } else {
                        this.mLargeVideoTime.setText("", false);
                        this.mLargeVideoTime.a(com.ss.android.article.base.feature.app.a.b.i, true);
                    }

                    this.mLargeButtonAd.a(this.mCellRef);
                    if (this.mArticle.isLiveVideo()) {
                        this.mLargeVideoTime.setDrawable(ContextCompat.getDrawable(this.context, com.ss.android.article.browser.R.drawable.live_video_tip), true);
                        this.mLargeVideoTime.setText(this.context.getString(com.ss.android.article.browser.R.string.live_video_tip), true);
                        this.mLargeImageVideoPlay.setImageResource(com.ss.android.article.browser.R.drawable.media_pause_icon_live_selector);
                        v0 = v5;
                    } else {
                        if (UIUtils.isVisible(this.mLargeVideoTime)) {
                            this.mLargeVideoTime.setDrawable(v2, true);
                        }
                        this.mLargeImageVideoPlay.setImageResource(com.ss.android.article.browser.R.drawable.playicon_video_selector);
                        v0 = v5;
                    }
                } else {
                    v0 = v5;
                }
            }

            if (v0 < 0) {
                v0 = ArticleHelper.getActualLargeImageHeight(this.mArticle.largeImageList, this.actualLargeImageWidth, isAd, this.maxLargeImageHeight);
            }

            UIUtils.setLayoutParams(this.mLargeImage, v13, v0);
            UIUtils.setLayoutParams(this.mRelatedVideoContainer, v13, v0);
            if (this.mVideoCoverLayout != null && this.mVideoCoverLayout.getVisibility() == View.VISIBLE) {
                UIUtils.setLayoutParams(this.mVideoCoverLayout, v13, v0);
            }

            if (this.cp) {
                this.t();
                if ((android.support.design.a.isTextEquals(this.mAppData.g(this.mCellRef.category), this.mCellRef.cellId)) && this.videoStyle == 9) {
                    UIUtils.setVisibility(this.mVideoSwitchInfosLayout, 0);
                    this.m();
                    this.mDivider.setVisibility(v12);
                    a(this.duplicatePressedRelativeLayout);
                }
            }

            ArticleHelper.setVisible(this.mLargeImage, this.mArticle.largeImageList);
            if ((this.mCellRef.f()) || this.videoStyle == 5) {
                v0_2 = this.mLargeImageLayout.getLayoutParams();
                ((ViewGroup.MarginLayoutParams) v0_2).leftMargin = 0;
                ((ViewGroup.MarginLayoutParams) v0_2).rightMargin = 0;
                ((ViewGroup.MarginLayoutParams) v0_2).topMargin = 0;
            }

            if (!v6_2) {
                this.loadImage();
                this.cg = false;
                return;
            }

            this.cg = true;
        }
    }

    private void s() {
        int v3 = com.ss.android.article.browser.R.drawable.og;
        int v2 = com.ss.android.article.browser.R.drawable.of;
        if (this.mMoreCommentsDiggInfoLayoutHolder != null && this.mMoreCommentsDiggInfoLayoutHolder.mMultiVideoDiggLayout != null) {
            this.mMoreCommentsDiggInfoLayoutHolder.mMultiVideoDiggLayout.setDiggAnimationView(this.mDiggAnimationView);
        }

        if (this.mMoreCommentsDiggInfoLayoutHolder != null && this.mMoreCommentsDiggInfoLayoutHolder.mMultiVideoBuryLayout != null) {
            this.mMoreCommentsDiggInfoLayoutHolder.mMultiVideoBuryLayout.setDiggAnimationView(this.mDiggAnimationView);
            this.mMoreCommentsDiggInfoLayoutHolder.mMultiVideoBuryLayout.a(v3, v2, AppData.isNightMode());
        }

        if (this.mDiggLayout != null) {
            this.mDiggLayout.setDiggAnimationView(this.mDiggAnimationView);
        }

        if (this.mBuryLayout != null) {
            this.mBuryLayout.setDiggAnimationView(this.mDiggAnimationView);
            this.mBuryLayout.a(v3, v2, AppData.isNightMode());
        }

        if (this.mAuthorVideoDiggLayout != null) {
            this.mAuthorVideoDiggLayout.setDiggAnimationView(this.mDiggAnimationView);
        }

        if (this.mAuthorVideoBuryLayout != null) {
            this.mAuthorVideoBuryLayout.setDiggAnimationView(this.mDiggAnimationView);
            this.mAuthorVideoBuryLayout.a(v3, v2, AppData.isNightMode());
        }

        if (this.mSwitchVideoDigg != null) {
            this.mSwitchVideoDigg.setDiggAnimationView(this.mDiggAnimationView);
        }

        if (this.mSwitchVideoBury != null) {
            this.mSwitchVideoBury.setDiggAnimationView(this.mDiggAnimationView);
            this.mSwitchVideoBury.a(v3, v2, AppData.isNightMode());
        }
    }

    private boolean t() {
        boolean v0 = true;
        if (this.videoControllerContext != null) {
            int v2 = this.mCellRef == null || !this.mCellRef.l() || !this.mCellRef.g() || this.mCellRef.videoStyle != 2 ? 0 : 1;
            if (v2 != 0) {
                return false;
            }

            IVideoController v2_1 = this.videoControllerContext.getVideoController();
            if (v2_1 != null && this.mArticle != null && !android.support.design.a.isTextEmpty(this.mArticle.videoId)) {
                if (this.mArticle.videoId.equals(v2_1.getVideoId())) {
                    this.mAppData.article = this.mArticle;
                    v2_1.resumeMedia(this.mLargeImage, this.mRelatedVideoContainer);
                } else {
                    v0 = false;
                }

                return v0;
            }

            v0 = false;
        } else {
            v0 = false;
        }

        return v0;
    }
}

